Commit Graph
1354 Commits
Author SHA1 Message Date
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
emellor@leeni.uk.xensource.com 39dbaabab7 Merged. 2006-03-03 15:56:34 +01:00
emellor@leeni.uk.xensource.com ecabde4c14 Change the way that reboot-timeouts are handled. Rather than refreshing the
list of domains each time XendDomainInfo.refresh is called, and spawning
threads for each shutdown still in progress, we watch the control/shutdown
node and spawn just the one thread immediately.  When the daemon starts (say
after a crash) all domains are checked for entries in the store indicating a
reboot in progress.

This avoids a large cost on the store and in threads when the list of domains
is refreshed.  This happens every time the server is queried, so the cost can
be quite high.  It's especially a high cost when using xm shutdown -a -w --
this operation should perform a lot better now.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-03 15:41:56 +01:00
kaf24@firebug.cl.cam.ac.uk 59d0a0335d This patch undoes 8697 and makes xm reboot/shutdown work again. This code
does expose a bug in xenstored when it is killed & restarted, but that
is not caused by this code.

My sincere appology to Ke Yu for the long wait and assuming his code
was broken.  His code was perfectly fine. Its just that my test scripts
did something for a historical reason that I should have removed a long
time ago.

Signed-Off-By: Leendert van Doorn <leendert@watson.ibm.com>
2006-03-03 10:56:54 +01:00
kaf24@firebug.cl.cam.ac.uk da53848714 Raises an explicit error message when the domain config file specifies
an incorrect path to a file-backed VBD (disk image) or the file-backed
VBD does not exist.

Without this patch, if someone mis-types the path to the disk image,
he/she would have no indication as to what's wrong when the domain
fails to get created.

Signed-off-by: Khoa Huynh <khoa@us.ibm.com>
2006-03-03 10:56:13 +01:00
emellor@leeni.uk.xensource.com 902bd89eeb Merged. 2006-02-27 18:44:38 +01:00
Ian.Campbell@xensource.com a6f599555c Add support for configuring feature flags when starting guests.
Guest configuration files may now contain a features= declaration
listing the features which should be enabled in a | separated
list.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-02-27 17:27:52 +00:00
emellor@leeni.uk.xensource.com 637c719f00 Reconstitute the ip parameter correctly. Closes bug #491.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-02-27 17:26:16 +01:00
kaf24@firebug.cl.cam.ac.uk 91bc5c3347 The disk isn't guaranteed to be the first device in the config sxp --
make sure we can restart domains when using a boot loader even if not.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-02-26 10:55:21 +01:00
kaf24@firebug.cl.cam.ac.uk ad55a2d28a Instead of using a static filename in the guest bootloader, use a random
filename so that multiple guests can start up simultaneously.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-02-26 10:53:18 +01:00
kaf24@firebug.cl.cam.ac.uk bb86d19e6e Per-vcpu IO evtchn patch for HVM domain.
We are starting to send patches to support SMP VMX guest.

Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-02-23 11:22:25 +01:00
kaf24@firebug.cl.cam.ac.uk c0b9da693c Cset 8916 missed two extra pages for VT-i domain and thus breaks domain
creation. This fixes it.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
2006-02-22 19:40:19 +01:00
kaf24@firebug.cl.cam.ac.uk 911d50521b Cleanups to tools since HVM domain P2M table and 1-1 table are built in xen.
Signed-off-by: Xin Li <xin.b.li@intel.com>
2006-02-21 18:23:35 +01:00
kaf24@firebug.cl.cam.ac.uk ac2f4cf2ca Add PAE option to HVM config file.
This option is disabled by default, only if we have "pae=1" in config
file, cpuid will return PAE available to VMX guest, and Linux PAE VMX
guest need this. Once the PAE VMX guest support is stable, we will
enable it by default.

Signed-off-by: Xin Li <xin.b.li@intel.com>
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
2006-02-21 18:15:49 +01:00
emellor@leeni.uk.xensource.com 1f52e936e5 This patch displays the network-list/block-list/vtpm-list using the 'xm'
command. It supports the '--long' option.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-02-17 19:35:38 +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
vhanquez@kneesa.uk.xensource.com cfb205ce16 When xc_linux_build fails without a meaninful errno, force errno to EINVAL
avoid message "Error creating domain: (0, 'Error')" in the case 
domU version is too old or too new.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-02-16 16:19:38 +00:00
mjw@wray-m-3.hpl.hp.com 1f536766b7 Fix exporting vnet config to xenstore.
Signed-off-by: Mike Wray <mike.wray@hp.com>
2006-02-10 17:14:56 +01:00