Commit Graph
94 Commits
Author SHA1 Message Date
Ewan Mellor 9b981ee160 Fix exception handling to cope with exceptions that do not have a string as
the first argument.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2007-02-27 11:19:25 +00:00
Alastair Tse 68da406e51 [XEND] Floats for not need to be stringified in Xen API.
Signed-off-by: Alastair Tse <atse@xensource.com>
2007-01-26 15:44:41 +00:00
Alastair Tse 53a668c52d [XEND] Change SrvServer to not require sockets to be non-blocking.
Set all spawned server threads to be daemonic and make sure their
sockets are closed properly using shutdown() and close(), otherwise
reload will complain about the "Address still in use."

Signed-off-by: Alastair Tse <atse@xensource.com>
2007-01-18 15:52:23 +00:00
Ewan Mellor 535e80fa87 Don't canonicalise the resource inside res_security_check if security is off.
This had broken use of relative paths to refer to ISOs etc.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2007-01-02 13:35:25 +00:00
Ewan Mellor a288b774b7 Fix xmlrpclib2's stringify to cope with floats and longs, removing the need
for explicit type conversions in XendAPI.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-28 16:30:47 +00:00
Ewan Mellor b16ecf8d4e Added Brctl.get_state, to support upcoming PIF implementation.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-27 15:39:32 +00:00
Ewan Mellor 86650d1bd2 Added Xen-API-style error handling for INTERNAL_ERROR and
MESSAGE_METHOD_UNKNOWN.  Only add the Xen-API methods to the official Xen-API
XML-RPC server, not to the legacy one.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-22 11:39:29 +00:00
Alastair Tse eb6c68c585 [XEND] Minor syntax cleanup in security.py for sxp parsing.
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-12-21 14:33:37 +00:00
Ewan Mellor c7a44ef04b Include the rotated xend.log.X in the bug report.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-01 13:06:15 +00:00
Ewan Mellor eb1eb71059 Tidy up the creation of directories that Xend needs. This avoids potential
races in this creation.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-12-01 11:32:32 +00:00
Ewan Mellor 027a790317 Implement an "allowed hosts" mechanism for the XML-RPC server layer, using
code from the relocation protocol handling and some plumbing.  Add a new
configuration entry for the Xen-API server, including use of this mechanism.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-11-28 10:23:34 +00:00
Andrew Warfield 650e610eda Fix breakage of blktap device strings from cset 63d1b02dad347e8feb845d8a8b482e251a478164.
Signed-off-by: Andrew Warfield <andy@xensource.com>
2006-11-14 11:20:45 -08:00
kfraser@localhost.localdomain de083f6648 [BLK] Expand number of fake-SCSI VBD volumes supported to 120.
Signed-off-by: Takanori Kasai <Kasai.Takanori@jp.fujitsu.com>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-11-09 12:07:28 +00:00
kaf24@firebug.cl.cam.ac.uk e935122cf5 [XEND] Compare result of blkdev_name_to_number() explicitly against None.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-11-02 07:46:06 +00:00
Ewan Mellor 54aa7f4832 Import the xen-unstable changeset
11863:7633398447846679342b197a79bc375b996d9026, with conflict resolution by
Ewan Mellor.

[XM] Allow empty resource strings (e.g., when creating an empty CDROM
device). Also clean up error/acces-denied path.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-23 12:23:57 +01:00
Ewan Mellor a81b06e66a Import the Xend portion of xen-unstable changeset
11839:328606e0705f0341bebda14cdd17962e463868e8.

Use the name of the title of the system to boot into (instead of the
kernel version) to determine where to make the entry into the grub
configuration file.

Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-10-20 09:32:16 +01:00
kfraser@localhost.localdomain 4b1bbbba6c [ACM] Fix the resource representations in the resource_label
file. Without this patch, multiple representations of the same
resource can co-exist in the resource label file and lead to errors
during operation.

Ensures that all resource file names are stored with absolute
path name and are unique. Setting labels of phy-resources, relative
paths will automatically be pre-pended with '/dev/'; labeling
file-resources with relative paths will raise an error.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-10-18 17:54:58 +01:00
Alastair Tse 48254bc2b0 [SOLARIS] The hotplug scripts live in a different place on Solaris.
Merged with Xen API Tree

Signed-off-by: John Levon <john.levon@sun.com>
2006-10-19 11:33:45 +01:00
kfraser@localhost.localdomain c139b7ee78 [XEND] Add missing line from changeset 11653:3b7e11cbeb940
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-10 16:02:30 +01:00
Alastair Tse 76b24ff4e2 [XEND] Updates to SR and VDI implementations
* Moved xenapi transport util method, stringify to xen.util.xmlrpclib2
* XenVDI now preserves configuration to an XML-ish file
* Update Xen API's class names to be all lowercase
* Update get_by_label to get_by_name_label and return sets as the API
  expects.
* Add support for VBD creation with a VDI reference.

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-13 15:13:21 +01:00
Alastair Tse 0e91588905 [XEND] Remove misleading debugging message
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=732

Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:20 +01:00
Alastair Tse d03a635aec [XEND] Make logging an optional parameter for the XMLRPCServer
Signed-off-by: Alastair Tse <atse@xensource.com>
2006-10-05 17:29:19 +01:00
Andrew Warfield 8e7cc683c5 [BLKTAP][XEND] Fix blktap to work with a bootloader
If a Xen guest has a bootloader configured, then it will fail to start
on a blktap image.  The problem is blkdev_uname_to_file, which cannot
parse the "tap:aio:$filename" image strings: it tries to split the
string apart at ":" and assign the result to a 2-tuple, and this
results in a python error if the split results in three or more
strings.

The fix is to split only at the first ":", and then to split again
if we detect "tap:" as the image type.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
2006-09-28 12:12:59 -07:00
Tim Deegan 1c80d1b0a3 [XEND] Don't prepend '/dev/' to any absolute path.
Check for '/' rather than '/dev/' when translating e.g. 'hda'->'/dev/hda'
Signed-off-by: Tim Deegan <tim.deegan@xensource.com>
2006-09-21 15:00:50 +01:00
kaf24@localhost.localdomain b643712258 [XEND] Move all of the various log files created by xen to
be under /var/log/xen instead of under /var/log directly.  This has
the advantage of cleaning things up a little and also can make it
easier to restrict the permissions needed by xend.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-08-28 13:05:00 +01:00
kfraser@localhost.localdomain 265853a73b Set the close-on-exec flag on the RPC socket in tool stack.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2006-08-15 16:26:39 +01:00
emellor@leeni.uk.xensource.com 03b3d1627f Better diagnosis of the failure when Xend crashes. Thanks to Hollis Blanchard
for diagnosis.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-08-09 09:52:43 +01:00
kfraser@localhost.localdomain 63c35d0351 [TOOLS] ppc64 is not a LIB_64_ARCH
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
2006-08-02 09:16:26 +01:00
kfraser@localhost.localdomain 2b9c0e336c [PCI] xend parses the user-space PCI backend policy files and sends
the corresponding fields to the PCI bus manager via sysfs nodes:

/sys/bus/pci/drivers/pciback/quirks
/sys/bus/pci/drivers/pciback/permissive

xend reads the policy file every time it creates a new domain that was
assigned a PCI device.

Signed-off-by: Chris Bookholt <hap10@tycho.ncsc.mil>
2006-07-28 12:57:55 +01:00
kfraser@localhost.localdomain a30dab89d4 [XM][ACM] Add xm subcommands to work with security resource labels.
This patch adds new xm subcommands to support working with resource
labels.  The new subcommands are 'xm resources', 'xm rmlabel', 'xm
getlabel' and 'xm dry-run'.  In addition, the 'xm addlabel' subcommand
now uses an updated syntax to support labeling both domains and
resources.  See the xm man page for details on each subcommand.

Beyond the new subcommands, this patch allows users to immediately see
when security checks will fail by pushing some basic security checking
into the beginning of 'xm create' and 'xm block-attach'.  ACM security
attributes for block devices are added to XenStore in order to support
the final security enforcement, which will be performed in the kernel
and included in a separate patch.

Signed-off-by: Bryan D. Payne <bdpayne@us.ibm.com>
Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
2006-07-10 17:18:07 +01:00
kaf24@firebug.cl.cam.ac.uk 66091ed16b [TOOLS] Make sure to explicitly close the connection if we're using HTTP/1.0. This
shouldn't be needed but it appears to be necessary as the Python client
just does a wfile.read() instead of only reading the reported Content-Length.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2006-06-22 15:10:48 +01:00
emellor@leeni.uk.xensource.com 522884b8be Move the SSHTransport class to its own file, so that we may disable SSH
transport when running on Python <2.4.  SSHTransport uses the new subprocess
class, and so it doesn't work on older versions.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-06-20 13:32:21 +01:00
root@rhesis.austin.ibm.com 321c94c756 This patch adds client side support for XML-RPC over ssh. It differs from
the previous submission in that it now uses lazy evaluation to connect
to the remote server and provides more user friendly error messages if ssh
is not available.

Signed-off-by: Anthony Liguori
2006-06-20 10:25:21 +01:00
anthony@rhesis.austin.ibm.com b908c58770 Add support to Xend XML-RPC server for HTTP/1.1 Keep-Alive.
This patch fixes a few bugs in the Python SimpleXMLRPC server and enables
HTTP/1.1 by default.  This allows a client to use Keep-Alive.  Keep-Alive
improves performance by eliminating the overhead of connection setup and,
more importantly, avoids credential caching when executing multiple
commands over a secure connection.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2006-06-20 10:25:18 +01:00
kaf24@firebug.cl.cam.ac.uk df70dfb525 [ACM] Provide the framework needed for resource labeling.
Subsequent patches will follow in the coming weeks that will enable 
Xen ACM to control assignment of resources (e.g., block devices and 
networking) to virtual machines based on resource labels and the 
active security policy.

Signed-off-by: Bryan D. Payne <bdpayne@us.ibm.com>
Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
2006-06-13 15:38:58 +01:00
kaf24@firebug.cl.cam.ac.uk bf39d68ed8 [SECURITY] Allow domid and ssidref args to get_decision in
util/security.py to be either strings or ints (previously only strings 
would work due to the underlying call to lowlevel.acm).

Signed-off-by: Bryan D. Payne <bdpayne@us.ibm.com>
Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
2006-06-01 18:30:28 +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
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 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 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 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 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 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
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
emellor@leeni.uk.xensource.com 64444a6982 Merged. 2006-03-23 14:26:38 +01:00
emellor@leeni.uk.xensource.com 9fffa2e25e Removed unused handler parameter from UnixXMLRPCServer interface -- just pass
UnixXMLRPCRequestHandler through to TCPXMLRPCServer.

Do not log requests -- this fills up xend-debug.log uselessly.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-23 11:40:43 +01:00
anthony@rhesis.austin.ibm.com 19c9e31146 Use XML-RPC as a transport for Xend instead of S-Expression/HTTP.
This changeset introduces a new XML-RPC service that runs in Xend and the
required changes to have xm use this new service by default.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2006-03-23 11:25:37 +01:00
kaf24@firebug.cl.cam.ac.uk d70271d485 Tools changes for PCI front/back drivers.
Replace the old pciif DevController class with a new one that
configures the PCI backend. A util class detects the resource usage of
the specified PCI devices and pciif interacts with Xen to permit a
driver domain to directly access those physical I/O resources.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-02-16 23:46:51 +01:00
emellor@leeni.uk.xensource.com 73f56f3e9b Added xen-hotplug.log to the files to collect.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 15:33:38 +00:00