Commit Graph
2682 Commits
Author SHA1 Message Date
Keir Fraser dfad53d5fe xend: Fix portability issue of lspci option.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-31 12:39:56 +01:00
Keir Fraser cd1f9abc4a Allow xm to spawn vnc viewer
The new merged qemu no longer has the ability to spawn a vnc viewer
process in the bowels of the xend/qemu stack.  In this patch we
provide support for this use case in a different manner - one more
akin to the mechanism used for `xm console' and `xm create -c'.

We introduce new xm options:
   xm create --vncviewer [--vncviewer-autopass]
   xm vncviewer [--vncviewer-autopass]

These spawn a VNC viewer, obtaining the relevant information
(including the port number and if you tell it your viewer supports it
the password to use) directly from xenstore.

Like xm console it waits in the foreground for the vnc port to become
available; the timeout case isn't handled as well as it might be - it
just causes the whole program (xm) to die with `Alarm clock' but this
is difficult to deal with given the current structure of the xs Python
lowlevel interface, which doesn't provide a timeout on the call to
wait for a xenstore watch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-07-30 16:22:45 +01:00
Keir Fraser 78130b8a28 xm, xenapi: Fix a problem in xm client for domain shutdown
Xm did not shut down domains anymore when run in xen-api mode due to a
'None' parameter being passed to xend when looking up a domain. This
fixes the problem.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-07-30 09:23:11 +01:00
Keir Fraser cacc71b173 xm: Enable a bootloader when using XM via Xen-API
This enables the usage of a bootloader, i.e., pygrub, when starting a
domain using xm in Xen-API mode.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-07-30 09:22:24 +01:00
Keir Fraser 5589b0008c xend, pci passthru: Use Dstate transition to do FLR for integrated
devices without proper FLR capability.

Currently integrated devices without proper FLR capability are not
assignable. This is not nice since actually they may be assignable,
but due to old BIOS the proper FLR capability is not exposed. We can
use the previously-used Dstate transition method to do FLR for them.
This works well and looks few issues are reported AFAIK. Maybe we can
make a black list for the (rare) integrated devices that don't work
with this method.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:29:23 +01:00
Keir Fraser 3c456fd628 xend, pci passthru: Relax the requirement of co-assignment.
Certain PCI or PCIe devices needs to be co-assigned. Currently we
require all the related devices be assigned to the same guest. This
can be relaxed to: part of them can be assgined to the same guest, and
after that, the left ones can't be assigned.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:28:45 +01:00
Keir Fraser a7d2697092 xend: Improve the error prompt when xc.test_assign_device() fails.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-28 11:27:48 +01:00
Keir Fraser cead514ad8 xend: fix dual destroy
After changeset 18030 and 18064 were checked in, I found some issues
when creating HVM domains with devices assigned.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-25 13:58:23 +01:00
Keir Fraser 6f79893756 tools: remove type parameter from xc_physdev_map_pirq{,_msi}()
... as it's implied by the function name.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-07-24 14:18:58 +01:00
Keir Fraser 33b7b2161a xend balloon: portability cleanup
Move the linux specific labels to osdep where they
belong. Modification on Solaris code ok'd by SUN (Ryan Scott).

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-22 11:55:06 +01:00
Keir Fraser 518aee2780 tools: cpuid inputs must be 32 character long if hexadecimal value is
not used.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
2008-07-21 14:03:26 +01:00
Keir Fraser 418ce6a531 xend: Fix keymap handling
Patch allows keymap to be specified inside vfb description and
allows VM configured keymap setting to override XenD default

Signed-off-by: Pat Campbell <plc@novell.com>
2008-07-21 09:47:07 +01:00
Keir Fraser ce88683ac9 xend: portability cleanup
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-18 14:14:12 +01:00
Keir Fraser 6ed3833291 xend: Fix destruction of VMMetrics objects for managed domains
While plugging a xend memory lead (c/s 18030), I introduced a bug in
the case of managed domains.  Managed domains continue to exist after
shutdown and thus should not have their associated VMMetrics object
destroyed until deleted.

The bug actually manifested by a new -> start -> shutdown -> delete
sequence of operations.  Shutdown destroyed the VMMetrics object and
delete tried to do the same :-):

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-07-16 11:12:36 +01:00
Keir Fraser c20060b5e0 tools: Make functions static which should not be exported.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-15 15:03:58 +01:00
Keir Fraser 63d459b855 Revert 18025:07c7aef164 -- go back to 8MB VRAM.
We may well want it in future anyway, and changing it makes
save/restore compatibility difficult.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-14 13:13:39 +01:00
Keir Fraser 73d5acf50f xm: vt-d: Add a command "xm pci-list-assignable-devices" to list all
the assignable devices.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-14 10:12:07 +01:00
Keir Fraser 22527b8dcd xend: vt-d: improved FLR logic for pass-thru PCI devices
1) If the device is PCIe endpoint and supports PCIe FLR, we use that;
else

2) if the device is PCIe endpoint, and all functions on the
device are assigned to the same guest, we use the immediate parent
bus's Secondary Bus Reset to reset all functions of the device (here,
actually we require all the functions of the device be assigned to the
same guest); else

3) if the device is PCI endpoint and is on a host bus
(e.g. integrated devices), and if the device supports PCI Advanced
Capabilities, we use that for FLR; else

4) we use the Secondary Bus Reset (if the PCI device is behind a
PCI/PCI-X bridge, then all devices behind the uppermost such PCI/PCI-X
bridge above this device must be co-assigned).

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-14 10:11:39 +01:00
Keir Fraser 6769cc1b63 xend: A small cleanup to the find_sysfs_mnt() of pci.py
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-07-14 10:09:25 +01:00
Keir Fraser 41296317a3 x86: allow control domain to limit machine addresses given to a particular guest
This allows domains which make buggy assumptions about the maximum
possible MFN to be worked around.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2008-07-11 12:51:26 +01:00
Keir Fraser b7e17149f3 xend: Ignore errors from dying domains in RPC server
When a domain is in the process of shutting down there is a small
window when the domain is known to XenD, but it will be unable to form
an SXPR for it due it being in the middle of device hot-unplug. This
causes the 'xm list' command to totally fail with an error like

# xm list
Error: Device 0 not connected
Usage: xm list [options] [Domain, ...]

The 'xm list' command calls into the 'domains' method of
XMLRPCServer.py in XenD. This method just iterates over the list of
domains, fetching the sxpr for each in turn, but with no exception
handling. So if a single domain fails to generate an sxpr, no data is
returned even for other domains which are still functional.  This
patch simply makes XenD ignore and skip over domains which throw an
exception, logging the problematic domain.

NB, this problem only hits 'xm list' if it is configured to use the
legay XMLRPC server instead of XenAPI.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2008-07-11 12:47:50 +01:00
Keir Fraser a896e816af Fix memory leak in xend
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-07-11 12:44:15 +01:00
Keir Fraser d91284f888 ioemu: drop unused 4MB video memory
Since we only emulate the cirrus VGA video card which is only able to
expose 4MB video memory, we don't need more than that.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-07-10 17:29:06 +01:00
Keir Fraser 292155263c Fix xm vcpu-pin for Domain-0
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-07-09 10:38:20 +01:00
Keir Fraser a3de16cb53 pvSCSI: fix xend
Previous "xend" assumed initial Xenbus state would be "Connected" when
LUN hot-plug starts. However it was not guaranteed in general, and it
may cause some problems.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
2008-07-08 09:28:50 +01:00
Keir Fraser 24342075ea numa: Extend MEMOP_ allocation functions to take a node argument.
The address_bits field will be limited to 8 bits and is now embedded
in the mem_flags member, which additionally contains the node number
(limited to 8 bit).

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-07-05 14:43:37 +01:00
Keir Fraser 17636f47a4 Teach xc_save to use event-channel-based domain suspend if available.
If the guest provides a suspend event channel through xenstore,
xc_save will use it in preference to the old xenstore-based method.

Xend is still informed when the domain has suspended so that it can
perform device migration in parallel with last-round migration.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2008-07-04 12:00:38 +01:00
Keir Fraser 08a42ca0b5 pvSCSI: xend changes
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
2008-07-03 13:39:06 +01:00
Keir Fraser 8e65d32968 XenAPI: Add Direct PCI Device (DPCI) Assignment Support
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-03 10:27:12 +01:00
Keir Fraser 5a940c0997 XenAPI: Add Physical PCI Device (PPCI) Support
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-03 10:26:16 +01:00
Keir Fraser aa506f9185 xend: Replace stray tab-indent with space-indent
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-07-02 09:42:37 +01:00
Keir Fraser 03f7fd7c9f xend: open qemu-dm logfile in append mode if log rotation is disabled by config.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-01 10:59:09 +01:00
Keir Fraser da67ff89f7 xend: improve the rotation of qemu-dm logfiles.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-01 10:58:43 +01:00
Keir Fraser dd258ce6c0 tools/python: fix TypeError for 17903:0728459b3c8d
If `hda' is used in domU config file and domain-0 has /dev/hda,
creating a domain failed by TypeError:

  File "//usr/lib/python/xen/xend/server/blkif.py", line 84, in
getDeviceDetails
    (device_path, devid) = blkif.blkdev_name_to_number(dev)
TypeError: unpack non-sequence

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2008-06-30 10:02:21 +01:00
Keir Fraser 2bb1ceab62 Fix up python breakage for blkdev_name_to_number
Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-30 10:01:44 +01:00
Keir Fraser bbc24abfb2 tools/python: blkdev_name_to_number fixes
Rework blkdev_name_to_number to allow the tools to attach xvd disks
beyond xvdp.

 1.  Adds the handling for the /dev/xvd[q-z] and /dev/xvd[a-i][a-z]
     extended devices

 2.  Changes blkdev_name_to_number() to return a tuple of (xenbus,
     devnum), and then deals with the resulting fallout.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2008-06-27 16:09:58 +01:00
Keir Fraser 8b53284ae7 [ACM] Pass uuid to created policy
A UUID needs to be passed to the created policy.

Signed-off-by: stefan Berger <stefanb@us.ibm.com>
2008-06-13 13:55:50 +01:00
Keir Fraser 639bf0b3c7 [ACM] Enable labeling of resources as inaccessible
Enable the labeling of (disk-type) resources with the special label
__INACCESSIBLE__ to prevent unlabeled domains from accessing them.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-06-13 13:55:19 +01:00
Keir Fraser fb0cba646e xend: detect and report qemu-dm failure
Currently, when qemu-dm fails, typically its exit status is lost and
xend doesn't notice.  In the patch below I use a fifo (named pipe) to
detect qemu-dm's termination and report the exit status to the
logfile, if possible.  (If xend has been restarted since the domain
was created, this isn't possible but we can still know that it failed
and report that fact.)

It would be better to have a failure of qemu crash the domain, by
calling the SCHEDOP_shutdown hypercall with SHUTDOWN_crash.  However
if you have on_crash=restart and the configuration is broken in some
way that causes qemu-dm to bomb out straight away this causes xend to
spin endlessly restarting the doomed domain.  This is a general
problem with on_*=restart and ought to be fixed separately.  When it
is fixed, we can safely arrange for domains whose dm has crashed to be
themselves forcibly crashed.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-06-12 17:01:31 +01:00
Keir Fraser 923ca284eb x86: cpuid configuration for PV guest
Add pv guest support for the cpuid configuration and checking. That
feature only works for cpuid request which are coming from the guest's
kernel, a process could still call the cpuid directly.

A new policy for pv guest has been created in libxc. dom0 cpuid
emulation is left hardcoded in Xen.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-06-11 11:35:35 +01:00
Keir Fraser 9f88f46834 Have `make install' write the Python version number in the #!
The Xen tools contain a number of Python extensions written in C.  The
C API to Python, used by these extensions, is not stable from one
version of Python to the next.

Our build system uses whatever version of Python is the default on the
build system at that time to build these extensions.  However, the
actual scripts such as `xm' use  #!/usr/bin/env python  which uses
whichever version of Python is the default on the deployment system at
the time of invocation.

If for any reason these two versions of Python are not the same (eg,
because the system is built on one computer and executed on another,
or because the system's gains a more recent Python installation
alongside the original which changes the previous default), warnings
and failures occur.

In this patch I arrange for Python scripts to be installed via a
special wrapper around `install', which determines the build-time
Python version and path and then writes that into the #! line at the
point of `make install' (or `make dist').  (It can also be overridden
by setting PYTHON_PATH.)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-06-11 09:36:23 +01:00
Keir Fraser fa3226f8f3 xend: minor ballooning cleanup
In xend/balloon.py, there's only one place where dom0_start_alloc_mb
is used. Move its initialization to right before its usage.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-06-10 14:53:01 +01:00
Keir Fraser f4692e35f1 xm on xenapi: Add PVFB support in xenapi_create.py.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-06-10 13:50:31 +01:00
Keir Fraser d32efbebf6 tools/python/xen/lowlevel: some cleanups
Mainly:
 malloc(n * m) -> calloc(n, m)
 sprintf -> snprintf

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-06-10 09:17:55 +01:00
Keir Fraser fd153d12f2 xm on xenapi: Fixes for rfb console.
- set 'vncunused' param default to 1
 - add 'vncdisplay' param
 - handle the case when sdl=1

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-06-09 09:47:51 +01:00
Keir Fraser 50cd7ffdad xend: Use get_config_string for 'keymap' and 'resource-label-change-script'.
Signed-off-by: Juergen Keil <jk@tools.de>
2008-06-09 09:42:51 +01:00
Keir Fraser a7cd0e3f91 acm: check for duplicate labels and types
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-06-09 09:37:56 +01:00
Keir Fraser 4c46d69b29 acm: Allow remove of labels from suspended domains.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-06-09 09:37:22 +01:00
Keir Fraser 3e22cc46bb xm: Set device_model option value default to None.
If device_model is set to '', xend will fail to execute the device
model.  If None, xend will detect it and set a sensible qemu-dm path
instead.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-06-09 09:36:27 +01:00
Keir Fraser b630504504 xm on xenapi: Enable more platform configurations
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-06-09 09:36:07 +01:00