Commit Graph
1271 Commits
Author SHA1 Message Date
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
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
emellor@leeni.uk.xensource.com f9617f8209 Fix call to send_sysrq.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-23 11:30:33 +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 7d6c54d484 Support late binding of PCI devices to the PCI backend driver in
dom0. This allows you to bind devices to the backend driver *after*
dom0 has booted. You are no longer required to specify the devices to
hide on the kernel command-line. Using the bind/unbind driver
attributes (see /sys/bus/pci/drivers/pciback), you can specify which
devices that the PCI backend will seize. There are three new driver
attributes in that directory:

slots       - lists all of the PCI slots that
              the PCI backend will try to seize
new_slot    - write the name of a slot here
              (in 0000:00:00.0 format) to have the PCI
              Backend seize the device in this slot
remove_slot - write the name of a slot here to have
              the PCI Backend no longer try to seize a
              device in this slot

Note that writing to new_slot/remove_slot does not actually change
whether the PCI Backend is actually bound to the device in that slot or
not. Instead, it tells the PCI backend which slots it should be
interested in. The sysfs attributes "bind" and "unbind" (which are
common to all drivers, not just the PCI Backend) must be used to
actually add or remove a device from the PCI backend driver. Note that
the syntax for specifying a device to bind and unbind is very strict (do
not append a newline).

For Example:

# Add a new slot to the PCI Backend's list
echo -n 0000:01:04.d > /sys/bus/pci/drivers/pciback/new_slot
# Now that the backend is watching for the slot, bind to it
echo -n 0000:01:04.d > /sys/bus/pci/drivers/pciback/bind

# Unbind a PCI network card from its network driver
echo -n 0000:05:02.0 > /sys/bus/pci/drivers/3c905/unbind
# And now bind it to the PCI Backend
echo -n 0000:05:02.0 > /sys/bus/pci/drivers/pciback/new_slot
echo -n 0000:05:02.0 > /sys/bus/pci/drivers/pciback/bind


Unfortunately, Linux makes it possible to remove (unbind) a PCI device
from the PCI backend while that device is attached to a driver domain.
It is also possible to unload the PCI Backend module while a PCI
Frontend is attached. DON'T DO EITHER OF THESE ACTIONS. This patch will
output warnings if you do try and do these. Be aware that while access
to the configuration space of the device has been revoked, the driver
domain can still access the I/O resources of the device as they have not
been revoked (although I *hope* to explore adding support for this
soon). Before unloading the module or unbinding a device, shutdown your
driver domain.

These patches also convert a few function and variable declarations to
static (no sense in polluting the global namespace with local function
names) and rename a few structures in drivers/xen/pciback/pci_stub.c.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-03-23 10:57:48 +01:00
emellor@leeni.uk.xensource.com fd1da4fbf1 Remove import of xen.lowlevel.xc, left over from when ballooning was done here
(moved to the server in December).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-21 12:45:59 +01:00
emellor@leeni.uk.xensource.com 1de73a0df0 Protect cleanupDomain with the refresh_shutdown_lock. This stops the device
and watch teardown being run concurrently from multiple threads, silencing
the No such file or directory error when tearing down the control/shutdown
watch, and reducing load on the store.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-21 12:41:33 +01:00
emellor@leeni.uk.xensource.com d3e701ea7f Remove unused, broken, redundant and undocumented option xm create -L.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-20 09:56:46 +01:00
kaf24@firebug.cl.cam.ac.uk 98b23dd14f Fix the bug that hvm domain network breaks after xm reboot. Root
cause: qemu network related info is not saved in xenstore, so after
reboot, this information is missing, and qemu can not start network.

Signed-off-by: Haifeng Xue <haifeng.xue@intel.com>
2006-03-14 15:40:44 +01:00
emellor@leeni.uk.xensource.com a04a7ff5d7 xm top was listed twice in the help message -- remove it from the Host Commands
section, leaving it in the Domain Commands section.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-13 11:10:27 +01:00
emellor@leeni.uk.xensource.com 99aa5b9d69 - Reworked to use your match_domid suggestion and filtering
- Aligned output and help to fit within 80 char limit
- User now deals in milliseconds instead of nanoseconds
- Fixed some missing parens in tests (I had pushed stale versions)
- Updated tests to deal with period/slice/latency in ms

root@bebop:~/xm-test.sedf/tests/sedf # xm sched-sedf
Name                              ID Period(ms) Slice(ms) Lat(ms) Extra Weight
Domain-0                           0      20.0      15.0     0.0      1      0

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2006-03-11 11:45:10 +01:00
emellor@leeni.uk.xensource.com 9956421b1d Trivial fix to bind implementation.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-11 11:19:11 +01:00
emellor@leeni.uk.xensource.com c785b4684e Simplify the interface into httpserver and UnixHttpServer -- the root and
interface parameters are always used, so there's no need for them to be named
parameters with defaults.

Remove unused httpserver.getRoot and getPort, and simplify the main request
loop.  This means that socket errors do not have to be squelched.

Coalesce the two identical bind methods, one in UnixHttpServer, one in
UnixListener.  Fix this bind method to set the permissions on the socket
explicitly.  This closes a security hole, and fixes the intermittent failure
of xm-test/06_list_nonroot.test.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-10 11:44:03 +01:00
emellor@leeni.uk.xensource.com 95c4e70768 Untangle XendRoot and XendLogging by having XendLogging check the global
params.XEND_DEBUG value itself.  This removes the need for addLogStderr and
removeLogStderr.  Remove the maxBytes and backupCount parameters to init, as
they are unused and we only use the hardcoded values anyway.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-10 11:38:15 +01:00
emellor@leeni.uk.xensource.com e3667a70ba The attached patch cleans up the parsing of /proc/xen/balloon that
occurs in xend.  Currently, the parsing is hard-coded; it expects that
the desired number is on the first line.  My patch is more robust; it
lets values be retrieved by a label.  It also exposes a few functions to
retrieve the current allocation and the target allocation.

By abstracting this a little better, I'll be able to address a few
other issues in subsequent patches.  Mostly, this allows for better
error checking and guidance for the user.  For example, by exposing
get_dom0_current_alloc(), we can (elsewhere, in a later patch) calculate
how large of a VM could potentially be started.  This is useful, as it
lets simple VM-creation GUIs guide the user towards reasonable memory
values for new VMs.

Signed-off-by:  Charles Coffing <ccoffing@novell.com>
2006-03-10 11:05:59 +01:00
emellor@leeni.uk.xensource.com 1687b5932a This patch
-Displays current parameters for running domains ala xm list
-Allow users to set one or more parameters without having to
 provide values for parameters they do not wish to change
-Adds additional testing of sched-sedf via new xm-test testcases.

With this patch applied, test 02_sedf_period_lower_neg.py exposes a
bug.  I'll follow up this email with a patch for the bug.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2006-03-10 01:08:59 +01:00
kaf24@firebug.cl.cam.ac.uk 2c727b6f3f Adds a new device interface to xend/xm similar to the one for ioports
where an interrupt (irq) can be specified in the configuration file
and permission to bind to that interrupt will be given to a driver
domain.

This functionality could be used when trying to give a legacy device
to a driver domain. For example, by specifying the i/o ports and the
interrupt of your serial controller, you can use this patch to put a
serial port in a driver domain. This was discussed briefly on
xen-users in regards to using an external modem in a domU:

http://article.gmane.org/gmane.comp.emulators.xen.devel/20573
http://article.gmane.org/gmane.comp.emulators.xen.user/8754

Also adds the ability to specify irqs on the xm command-line when
creating a domain (the following examples show a serial port being
given to a domU):

xm create serial-dd irq=4 ioports=03f8-03ff

or in a flat config-file:

irq = [4]
ioports = ['03f8-03ff']

or in an SXP config file:

(device (irq (irq 4)))
(device (ioports (from '0x03f8')(to '0x03ff')))

The ioports functionality is already in xen, but this patch also fixes a
bug with it that I assume cropped up due to changes in xend since it was
submitted ('dev' doesn't exist in iopif.py, returning 'None' seems to be
the solution).

Also adds some in-line documentation in tools/python/xen/xm/create.py
to be more accurate regarding adding pci devices and i/o ports on the
command-line.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-03-09 11:20:31 +01:00
kaf24@firebug.cl.cam.ac.uk a5414d898b Ensure old Python files are overwritten during tools install.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2006-03-08 11:18:39 +01:00
emellor@leeni.uk.xensource.com 8ee550dbe0 Allow callers to XendClient.xend_list_domains to specify the detail flag, and
turn detail off when doing vcpu-list.  This avoids calls to xenstore just to
get the list of domains for the vcpu-list call, significantly increasing
performance of that command on loaded systems.

Closes bug #545.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-04 19:15:36 +01:00