aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authoremellor@ewan <emellor@ewan>2005-10-06 11:12:55 +0100
committeremellor@ewan <emellor@ewan>2005-10-06 11:12:55 +0100
commit705f86977c04583539b2eff779f63d15690de2e6 (patch)
tree092ec558c24705b759d13f3980ca57937232a23a /tools
parent10956b773945319f50f76beedf801cb0739457ff (diff)
parente926a106968c31292ed850b60197fb9af112d69e (diff)
downloadxen-705f86977c04583539b2eff779f63d15690de2e6.tar.gz
xen-705f86977c04583539b2eff779f63d15690de2e6.tar.bz2
xen-705f86977c04583539b2eff779f63d15690de2e6.zip
Merged.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/examples/network-bridge22
-rw-r--r--tools/libxc/xc_evtchn.c57
-rw-r--r--tools/libxc/xenctrl.h4
-rw-r--r--tools/python/xen/lowlevel/xc/xc.c10
-rw-r--r--tools/python/xen/xend/server/tpmif.py17
-rw-r--r--tools/python/xen/xm/main.py4
6 files changed, 64 insertions, 50 deletions
diff --git a/tools/examples/network-bridge b/tools/examples/network-bridge
index f862db0c3f..f0e1e1648d 100755
--- a/tools/examples/network-bridge
+++ b/tools/examples/network-bridge
@@ -39,6 +39,17 @@
#
#============================================================================
+# Gentoo doesn't have ifup/ifdown: define appropriate alternatives
+which ifup >& /dev/null
+if [ "$?" != 0 -a -e /etc/conf.d/net ]; then
+ ifup() {
+ /etc/init.d/net.$1 start
+ }
+ ifdown() {
+ /etc/init.d/net.$1 stop
+ }
+fi
+
# Exit if anything goes wrong.
set -e
@@ -55,17 +66,6 @@ antispoof=${antispoof:-no}
echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2
-# Gentoo doesn't have ifup/ifdown: define appropriate alternatives
-which ifup >& /dev/null
-if [ "$?" != 0 -a -e /etc/conf.d/net ]; then
- ifup() {
- /etc/init.d/net.$1 start
- }
- ifdown() {
- /etc/init.d/net.$1 stop
- }
-fi
-
# Usage: transfer_addrs src dst
# Copy all IP addresses (including aliases) from device $src to device $dst.
transfer_addrs () {
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index f7698d3541..ed6256654b 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -33,15 +33,16 @@ static int do_evtchn_op(int xc_handle, evtchn_op_t *op)
int xc_evtchn_alloc_unbound(int xc_handle,
+ u32 remote_dom,
u32 dom,
int *port)
{
- evtchn_op_t op;
int rc;
-
- op.cmd = EVTCHNOP_alloc_unbound;
- op.u.alloc_unbound.dom = (domid_t)dom;
- op.u.alloc_unbound.port = (port != NULL) ? *port : 0;
+ evtchn_op_t op = {
+ .cmd = EVTCHNOP_alloc_unbound,
+ .u.alloc_unbound.remote_dom = (domid_t)remote_dom,
+ .u.alloc_unbound.dom = (domid_t)dom,
+ .u.alloc_unbound.port = (port != NULL) ? *port : 0 };
if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
{
@@ -59,15 +60,13 @@ int xc_evtchn_bind_interdomain(int xc_handle,
int *port1,
int *port2)
{
- evtchn_op_t op;
int rc;
-
- op.cmd = EVTCHNOP_bind_interdomain;
- op.u.bind_interdomain.dom1 = (domid_t)dom1;
- op.u.bind_interdomain.dom2 = (domid_t)dom2;
- op.u.bind_interdomain.port1 = (port1 != NULL) ? *port1 : 0;
- op.u.bind_interdomain.port2 = (port2 != NULL) ? *port2 : 0;
-
+ evtchn_op_t op = {
+ .cmd = EVTCHNOP_bind_interdomain,
+ .u.bind_interdomain.dom1 = (domid_t)dom1,
+ .u.bind_interdomain.dom2 = (domid_t)dom2,
+ .u.bind_interdomain.port1 = (port1 != NULL) ? *port1 : 0,
+ .u.bind_interdomain.port2 = (port2 != NULL) ? *port2 : 0 };
if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
{
@@ -85,12 +84,11 @@ int xc_evtchn_bind_virq(int xc_handle,
int virq,
int *port)
{
- evtchn_op_t op;
int rc;
-
- op.cmd = EVTCHNOP_bind_virq;
- op.u.bind_virq.virq = (u32)virq;
- op.u.bind_virq.vcpu = 0;
+ evtchn_op_t op = {
+ .cmd = EVTCHNOP_bind_virq,
+ .u.bind_virq.virq = (u32)virq,
+ .u.bind_virq.vcpu = 0 };
if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
{
@@ -106,10 +104,10 @@ int xc_evtchn_close(int xc_handle,
u32 dom,
int port)
{
- evtchn_op_t op;
- op.cmd = EVTCHNOP_close;
- op.u.close.dom = (domid_t)dom;
- op.u.close.port = port;
+ evtchn_op_t op = {
+ .cmd = EVTCHNOP_close,
+ .u.close.dom = (domid_t)dom,
+ .u.close.port = port };
return do_evtchn_op(xc_handle, &op);
}
@@ -117,9 +115,9 @@ int xc_evtchn_close(int xc_handle,
int xc_evtchn_send(int xc_handle,
int local_port)
{
- evtchn_op_t op;
- op.cmd = EVTCHNOP_send;
- op.u.send.local_port = local_port;
+ evtchn_op_t op = {
+ .cmd = EVTCHNOP_send,
+ .u.send.local_port = local_port };
return do_evtchn_op(xc_handle, &op);
}
@@ -129,13 +127,12 @@ int xc_evtchn_status(int xc_handle,
int port,
xc_evtchn_status_t *status)
{
- evtchn_op_t op;
int rc;
+ evtchn_op_t op = {
+ .cmd = EVTCHNOP_status,
+ .u.status.dom = (domid_t)dom,
+ .u.status.port = port };
- op.cmd = EVTCHNOP_status;
- op.u.status.dom = (domid_t)dom;
- op.u.status.port = port;
-
if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
memcpy(status, &op.u.status, sizeof(*status));
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 2fe9bee750..3e74c62fa0 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -306,13 +306,15 @@ typedef evtchn_status_t xc_evtchn_status_t;
* well-known port within a domain to receive events on.
*
* @parm xc_handle a handle to an open hypervisor interface
- * @parm dom the ID of the domain. This maybe DOMID_SELF
+ * @parm remote_dom the ID of the domain who will later bind
+ * @parm dom the ID of the local domain (the 'allocatee')
* @parm port a pointer to a port. This is an in/out parameter. If *port is
* 0, then a new port will be assigned, if port is > 0 then that
* port is allocated if the port is unallocated.
* @return 0 on success, -1 on failure
*/
int xc_evtchn_alloc_unbound(int xc_handle,
+ u32 remote_dom,
u32 dom,
int *port);
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index d096b7bb96..7ff5b40ca9 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -432,16 +432,16 @@ static PyObject *pyxc_evtchn_alloc_unbound(PyObject *self,
{
XcObject *xc = (XcObject *)self;
- u32 dom;
+ u32 dom = DOMID_SELF, remote_dom;
int port = 0;
- static char *kwd_list[] = { "dom", "port", NULL };
+ static char *kwd_list[] = { "remote_dom", "dom", "port", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list,
- &dom, &port) )
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|ii", kwd_list,
+ &remote_dom, &dom, &port) )
return NULL;
- if ( xc_evtchn_alloc_unbound(xc->xc_handle, dom, &port) != 0 )
+ if ( xc_evtchn_alloc_unbound(xc->xc_handle, remote_dom, dom, &port) != 0 )
return PyErr_SetFromErrno(xc_error);
return PyInt_FromLong(port);
diff --git a/tools/python/xen/xend/server/tpmif.py b/tools/python/xen/xend/server/tpmif.py
index 50e8f7f016..b5269a2cb0 100644
--- a/tools/python/xen/xend/server/tpmif.py
+++ b/tools/python/xen/xend/server/tpmif.py
@@ -39,9 +39,24 @@ class TPMifController(DevController):
"""@see DevController.getDeviceDetails"""
devid = int(sxp.child_value(config, 'instance', '0'))
- log.debug("The domain has a TPM with instance %d." % devid)
+ log.info("The domain has a TPM with instance %d." % devid)
back = { 'instance' : "%i" % devid }
front = { 'handle' : "%i" % devid }
return (devid, back, front)
+
+ def configuration(self, devid):
+
+ log.info("The configuration method is called.")
+
+ result = DevContoller.configuration(self, devid)
+
+ (instance) = self.readBackend(devif,
+ 'instance')
+
+ if instance:
+ result.append(['instance', instance])
+ log.info("configuration: instance=%d." % instance)
+
+ return result
diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
index 1ce9985a1c..df458c5d88 100644
--- a/tools/python/xen/xm/main.py
+++ b/tools/python/xen/xm/main.py
@@ -86,8 +86,8 @@ xm full list of subcommands:
shutdown [-w|-a] <DomId> shutdown a domain
sysrq <DomId> <letter> send a sysrq to a domain
unpause <DomId> unpause a paused domain
- vcpu-enable <DomId> <VCPU> disable VCPU in a domain
- vcpu-disable <DomId> <VCPU> enable VCPU in a domain
+ vcpu-enable <DomId> <VCPU> enable VCPU in a domain
+ vcpu-disable <DomId> <VCPU> disable VCPU in a domain
vcpu-list <DomId> get the list of VCPUs for a domain
vcpu-pin <DomId> <VCpu> <CPUS> set which cpus a VCPU can use.