Commit Graph
1289 Commits
Author SHA1 Message Date
kaf24@firebug.cl.cam.ac.uk cf6a9db5e6 The PciController class lacks a configuration method to re-generate the
configuration of an existing domain. This is needed for a domain to be
able to reboot and retain its PCI device configuration. This patch adds
such support.

Thanks to Mike Wright for reporting this problem and working with me to
fix it.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-05-10 16:07:46 +01:00
emellor@leeni.uk.xensource.com 30907c5593 Merged. 2006-05-05 18:36:26 +01:00
emellor@leeni.uk.xensource.com c1124c5993 Use the auxbin module to find the appropriate install directory for our Python
scripts.

This fixes a bug with xm-test not working on 64-bit systems.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-05-05 18:36:12 +01:00
emellor@leeni.uk.xensource.com c185594788 Remove ssidref field from test -- this now only works if there is a policy in
place at the time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-05-05 16:46:48 +01:00
kaf24@firebug.cl.cam.ac.uk c61c155041 Instead of just having the bootloader config sxp replace anything else,
merge with given values.  This will allow a bootloader to not have to
specify everything which is useful for bootloaders other than pygrub.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-05-05 14:09:07 +01:00
kaf24@firebug.cl.cam.ac.uk be3309cba2 Fix python pciif script to reference correct 2.0 compatibility variable.
In the Xen 2.0.x compatibility section of xend (where we try to parse
the s-expressions if they came from an SXP configuration file for Xen
2.0.x), the wrong variable is referenced. This fix corrects the python
script to use the correct variable.

Thanks to Mike Wright for reporting this.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-05-05 14:01:43 +01:00
kaf24@firebug.cl.cam.ac.uk daac965083 Instead of knowing explicitly about the pygrub entry option, allow
passing arbitrary options to the bootloader and deprecate the bootentry
option.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-05-03 11:02:30 +01:00
kaf24@firebug.cl.cam.ac.uk 2d0922d515 Move Linux-specific privcmd code into private libxc implementations.
Make header path for kernel's privcmd/evtchn headers generic.
Remove pointless xi_*() interface that was using private libxc
interfaces.

Signed-off-by: John Levon <john.levon@sun.com>
2006-05-02 15:12:06 +01:00
kaf24@firebug.cl.cam.ac.uk 5308dc5660 Debugging Xend with XEND_DAEMONIZE set to False doesn't work as
expected.  Xend actually creates two children and the XEND_DAEMONIZE  
flag only prevents one of the children from being created.  This  
patch causes none of the children to be created.  With this patch,  
Xend functionality is performed in the process executed from the  
command line (i.e., /usr/sbin/xend).  This patch makes it possible to  
debug Xend with pdb.

Signed-off-by: Randy Thelen <rthelen@netapp.com>
2006-04-30 09:52:59 +01:00
kaf24@firebug.cl.cam.ac.uk c57010da2d Instead of relying on xm create to always run the bootloader, make sure
we run it if we get into domain creation with a bootloader set but no
image.  This could happen if someone creates a domain config via the
XML-RPC or sxp interfaces.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-04-28 14:11:57 +01:00
kaf24@firebug.cl.cam.ac.uk 7c059c05f5 The features for a domain are more a property of the domain than the
image.  Move them into the domain info so that the image is just the
pieces needed for booting (eg, kernel + initrd + args)

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-04-28 14:10:59 +01:00
kaf24@firebug.cl.cam.ac.uk dd8d11c33b The bootloader code doesn't actually have to deal with the vcpu config
anymore as that's just in the domaininfo.  So stop doing so.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-04-28 14:09:35 +01:00
smh22@firebug.cl.cam.ac.uk 5ab002b998 This patch integrates the new access control management tools into 'xm'
and 'xend' and supports label/ssid translation support for 
migration/life-migration/resume.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:59:17 +01:00
smh22@firebug.cl.cam.ac.uk e7f4f3a1de This patch adds new python access control management scripts, which
integrate into Xen Management and which support the new access control 
labels (labels replace the ssidref numbers at the management user 
interface).

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:58:25 +01:00
emellor@leeni.uk.xensource.com df0c8173e2 The attached patch replaces the current numbers identifying the
individual steps of device migration with constants.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-04-21 11:57:34 +01:00
kaf24@firebug.cl.cam.ac.uk f9afb49240 Fix python installation on sles10. Install prefix is being
passed along for some reason, so we explicitly redefine it
to nothing.

Signed-off-by: Ryan Grimm <grimm@us.ibm.com>
2006-04-21 09:14:07 +01:00
emellor@leeni.uk.xensource.com d4184d7e40 Continue to diagnose the device state, even if Xend has crashed.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-20 17:16:27 +01:00
emellor@leeni.uk.xensource.com abd30192c0 This patch enables external devices, such as for example a mounted hard
drive image or a TPM, to be migrated to a remote machine. The patch
hooks into the checkpointing (XendCheckpoint.py) code and performs
migration in 4 different steps:

In a 1st step (step = 0 in the code) migration of all devices of a
domain is 'tested', that means their driver implementations (blkif.py,
netif.py, tpmif.py, usbif.py, pciif.py) are queried whether migration is
possible at all. Currently all device representations respond with a
'yes' (=0), although probably a VM mounting a hard drive partition
should respond with a 'no' (-1) already. This first step is a quick
check to see whether devices can be migrated.

The 2nd step is to do whatever can be done before the domain is
suspended. At this point migration of the device could be initiated, if
at all possible.

The 3rd step is to migrate a device after the domain has been suspended,
meaning that it is not scheduled anymore and the VM is 'settled'. All
devices are called again and a good implementation would initiate the
migration in a background process to achieve as much concurrency as
possible.

The 4th step is to synchronize with the 3rd step. At this point the
implementor has to make sure that anything that was initiated in step 3
has completed. Once all steps 4 have been processed, the VM will resume
on the remove machine.

I have implemented hooks for migration of a virtual TPM in
xen/xend/server/tpmif.py. These hooks call a configurable external
migration tool using the os.popen() call with a fixed command line
parameter set. The implementation refuses to migrate a VM attached to a
virtual TPM if no tool has been provided for migration.
All other devices do not currently overload the 'migrate' method defined
in the DevController.py and therefore will just let migration happen.

I have added hooks for error recovery such that whatever part of
migration has been initiated can be rolled back when any of the devices
fail to migrate in one of the steps. The interface (in tpmif.py) to the
external application now uses os.popen() to allow error handling by
reading the application's output.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-04-14 21:22:09 +01:00
Ryan Harper 73b491c2a0 Allow cpus parameter to xm create to accept a range string by removing the
restriction of cpus accepting only integers.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2006-04-14 21:15:38 +01:00
kaf24@firebug.cl.cam.ac.uk e59a11f58d Fix stack corruption in the libxs python interface. domid_t is a short;
instead use uint32_t like we do in xc.c.

Signed-off-by: John Levon <john.levon@sun.com>
2006-04-13 19:14:11 +01:00
kaf24@firebug.cl.cam.ac.uk b5fa90ac8e build: Clean up use of .PHONY
* Move .PHONY directives next to targets,
  this makes them a lot harder to miss
* Add missing .PHONY directives
* Remove nonexistent .PHONY directives
* Hopefully I didn'T miss anything...

Signed-Off-By: Horms <horms@verge.net.au>
2006-04-10 17:02:49 +01:00
emellor@leeni.uk.xensource.com 224cab0dfd Merged. 2006-04-10 16:36:03 +01:00
emellor@leeni.uk.xensource.com 913843e16b Fix call to server, using new XendClient syntax.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-10 16:26:23 +01:00
emellor@leeni.uk.xensource.com 9a74026a08 I used the wrong operator in a couple places for putting together some
error messages out of format strings. This patch corrects those
operators and fixes the strings.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-04-10 14:47:51 +01:00
emellor@leeni.uk.xensource.com 45bd0044c4 Factor out the parsing of XAUTHORITY, so that it can be used by the unit test,
and fix that test to use it.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-06 14:22:52 +01:00
emellor@leeni.uk.xensource.com d5ed151f12 Fix test to match change to DCE formatting of UUIDs.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-06 14:21:45 +01:00
emellor@leeni.uk.xensource.com d220279c33 Further workarounds for the broken string marshalling in xmlrpclib. Regardless
of the encoding used, one still may not include non-printable characters in an
XML document.  When a dmesg contains a ^D character, something seen on one of
our test machines, an invalid XML document is generated.

Use a trick by David Mertz to work around this -- escape the string using
Python's repr function.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-06 00:59:06 +01:00
emellor@leeni.uk.xensource.com c0693d2c6e Workaround bug in xmlrpclib's string escaping. That library outputs invalid
UTF-8 if given a string containing high-bit characters, so instead pass in
Unicode strings, for which the escaping is correct.

This fixes a bug seen when the dmesg of a machine contains high bit characters,
but I'm sure there are other ways in which it might be triggered.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-04 11:08:20 +01:00
emellor@leeni.uk.xensource.com cb52e35a60 Merged. 2006-04-03 23:58:40 +01:00
emellor@leeni.uk.xensource.com 2df295f268 Lookup backend by name _or_id_. This is important for domain 0, for example!
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-03 23:57:42 +01:00
emellor@leeni.uk.xensource.com d0263f0fa4 Fix cpus string parsing, wrt use of ^ to remove elements.
Patch from Satoshi Uchida <s-uchida@ap.jp.nec.com>.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-03 18:39:21 +01:00
tkuik@tkuik-lnx2.cisco.com d2a5e52e8c Allow a domain other than Domain-0 to be a backend.
Signed-off-by: Tim Kuik tkuik@cisco.com
2006-04-03 18:23:00 +01:00
kaf24@firebug.cl.cam.ac.uk d057bf8506 When dom0 fails to balloon enough memory to allow a new domain to start,
an exception is thrown.  The test that decides which exception to throw
is backwards, resulting in strange error messages.  The attached patch
fixes the problem.

Signed-off-by:  Charles Coffing <ccoffing@novell.com>
2006-04-01 10:52:47 +01:00
kaf24@firebug.cl.cam.ac.uk e5829dcbe1 Plumb network vif credit-based rate limiting thorugh xenbus
and xend into xm guest config files.

A new vif parameter 'rate' is supported, with an optional time window
paremeter for specifying granularity of credit replenishment. The default
window is 50ms. For example:

 'rate=10Mb/s'  'rate=250KB/s'  'rate=1MB/s@20ms'

From: Chris Clark <christopher.w.clark@gmail.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-31 15:34:52 +01:00
kaf24@firebug.cl.cam.ac.uk f8253f9f48 Currently, xm & xend allow an XAUTHORITY to be specified in the config
file.  If that is not specified, then xm will pass the XAUTHORITY
environment variable back to xend instead.  This is not sufficient,
since it is possible that XAUTHORITY is not set at all.  This doesn't
cause a problem for most X apps, because xlib will use the fall-back of
$HOME/.Xauthority.  But the viewer is started from xend, which almost
certainly doesn't have a reasonable HOME variable.

We fix this by always passing some value for
XAUTHORITY.  In order of preference, that value is:
1.  Use the value from the config file, if specified.
2.  Use the value from the XAUTHORITY env variable, if set.
3.  Use $HOME/.Xauthority, if HOME is set.
4.  Look up the user's home directory via getpwuid, and append
"/.Xauthority"

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-03-31 13:51:19 +01:00
emellor@leeni.uk.xensource.com 0464aecf6c Better formatting of error messages for xmlrpclib.Faults, matching similar code
in main.py.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-31 00:15:12 +01:00
emellor@leeni.uk.xensource.com 6b914525af Print error messages to stderr. Remove unused handle_xend_error.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-31 00:14:09 +01:00
emellor@leeni.uk.xensource.com 8d3271b7cc Set the permissions correctly on the XML-RPC UDP socket, so that non-root users
cannot use the socket.

This closes a security hole, and fixes the intermittent failure
of xm-test/06_list_nonroot.test.

c.f. xen-unstable changeset 9205:faa1eb1621b9 (same bug, different socket).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-31 00:13:33 +01:00
emellor@leeni.uk.xensource.com 51260a849c Check the return value of domain_lookup_by_name_or_id_nr for None (i.e. no
such domain) inside each of the public-facing functions.  This fixes the
Internal errors seen when specifying an invalid domain.

domain_pincpu takes cpumap, which is a list, not a string, so there's no need
to try and split it up.  Fixes xm vcpu-pin.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-30 11:54:07 +01:00
emellor@leeni.uk.xensource.com c705b05a31 Fix the ProtocolError seen when the server throws an exception and running
under Python 2.3; traceback.format_exc was introduced in 2.4, so we can't use
it.

Added some exception logging.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-30 11:51:44 +01:00
anthony@rhesis.austin.ibm.com bf95282732 Remove vcpu_avail from the public S-Expression that's passed over the wire.
This trips up the XML-RPC layer on large SMP systems and isn't actually used
by xm.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2006-03-29 14:50:57 +01:00
emellor@leeni.uk.xensource.com 81094db8cb Merged. 2006-03-28 11:52:47 +01:00
emellor@leeni.uk.xensource.com 5be19e898d Watch for @introduceDomain, for symmetry with the existing watch on
@releaseDomain.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-28 11:26:29 +01:00
emellor@leeni.uk.xensource.com d4a55b4a44 Have TCPXMLRPCServer inherit from SocketServer.ThreadingMixIn. This allows
Xend to handle more than one request simultaneously once again.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-28 11:25:22 +01:00
anthony@rhesis.austin.ibm.com 76e09e8238 1) Introduce new exception type XendInvalidDomain that maps to the high level
XEND_INVALID_DOMAIN faultType.
2) Fix exception logic in XMLRPCServer
3) Fix TCP server
4) Remove catching of ProtocolError in main.py.  ProtocolErrors only occur
   when there is an exception in the exception handling code which shouldn't
   ever happen.  I've reproduced the error cases described by Ewan with
   xend_domain_setTargetMemory and once I fixed the exception logic, I get a
   normal faultType of 1 as would be expected.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2006-03-24 14:31:12 +01:00
emellor@leeni.uk.xensource.com 64444a6982 Merged. 2006-03-23 14:26:38 +01:00
emellor@leeni.uk.xensource.com 88aea7e5a8 Improve error handling, in particular fixing the ProtocolError that is thrown
when a domain is specified by the user that does not exist.  Added a few
error codes -- many more to come, I expect.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-23 12:59:43 +01:00
emellor@leeni.uk.xensource.com 91c4832c49 Added exception handler for ProtocolError.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-23 11:58:19 +01:00
emellor@leeni.uk.xensource.com af19ef96d4 Added example config entries for xend-tcp-xmlrpc-server and
xend-unix-xmlrpc-server.  Deprecate the SXP-based servers, and disable them
by default.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-23 11:55:56 +01:00
emellor@leeni.uk.xensource.com cf2c1b2e25 Use the string Error: rather than Xend has generated an internal Fault:.
xm-test looks for this.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-23 11:42:19 +01:00