Commit Graph
2700 Commits
Author SHA1 Message Date
Keir Fraser 2a82334fcc xend: Avoid multiple assignments to same dict key in pci_convert_sxp_to_dict
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-08-26 10:14:32 +01:00
Keir Fraser 154ef9e3cc vtd: Don't do FLR when we create domain or hotplug device into guest.
VT-d hot-plug is done in such a way:  1) xend sends 'pci-ins' command
to ioemu via xenstore; 2) ioemu creates pass-through device and raises
SCI to guest OS; guest OS loads device driver, and device driver
initializes the hot-plugged device; 3) xend does FLR. There is a race
condition about 2) and 3). If 3) runs slow, we have troubles. Thanks
for Yuji Shimada's locating the issues.

We can work around the issues by not doing FLR when we create domain
or hotplug device into guest, namely, we only do FLR when we destroy
domain or hotplug device from guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2008-08-19 10:51:41 +01:00
Keir Fraser d74b976c41 xend: fixes a typo in the PIF class of the Xen-API code.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-08-19 10:48:39 +01:00
Keir Fraser 74f9ac9665 xend: Make sure that 'PV_kernel' config param is not blank when
assigning it to 'loader' param. This fixes a failure of 'xm create'
via xen-api.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-08-13 13:40:38 +01:00
Keir Fraser 8712242693 xend/xenapi: Initialize a VLAN PIF's record with the MAC and MTU size
of the created network interface

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-08-11 16:51:02 +01:00
Keir Fraser dea6d8b20c xend/xen-api: Have the VDI record return the security label
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-08-11 15:01:34 +01:00
Keir Fraser 3ca259a393 xend: Better support for legacy HVM config of ia64
On ia64, direct Linux boot is not supported, and 'Flash.fd' or
'guest_firmware.bin' has been used as a value of the 'kernel'
option. Cset:17016 ignores those strings and overrides them with
"/usr/lib/xen/boot/hvmloader".

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-11 11:27:40 +01:00
Keir Fraser 8a067f68b1 ia64: PV driver domains - ugly python hacks
x86 IOMMU support added a lot of assumptions about what PCI buses look
like and where to find bridge devices.  On ia64, we don't yet have
virtualization friendly IOMMUs, so for the moment, we just want to
keep "unsafe" PV PCI pass through working as well as it did in Xen
3.2. Looking at the code, it almost seems like x86 has thrown out
support for the old style driver domain.  Things that don't
necessarily work on every PCI compliant architecture:

      * You can't assume that just because there's a device at 01:01.0
        that there's also a bridge at 01:00.0 and blow-up when you
        don't find it.  On HP ia64 boxes, PCI root bridges are not
        necessarily exposed as a PCI device.  This pretty much means
        we can't call into any of the "FLR" code paths.
      * BAR alignment: it's hard to have BAR alignment when your page
        size is 16k.  This wasn't a requirement for previous PV driver
        domains, so I assume it's only for IOMMU support.

This is ugly, so I'm open to suggestions.  It seems that all of these
architecture checks could be replaced by checking some "iommu_present"
variable to test whether the extra requirements are necessary.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2008-08-08 10:53:40 +01:00
Keir Fraser 97503a73e3 xm: fix trivial typo. s/ciredump-restore/coredump-restart/
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2008-08-07 09:05:31 +01:00
Keir Fraser ccecac2def xend: vncconsole config option mustn't be a string
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-05 13:45:25 +01:00
Keir Fraser 95d4283bb4 ioemu: Do not pass -m (memory) option to qemu, as ioemu-remote rejects
memory sizes greater than 2GB when built as a 32-bit binary.

Instead, direct HVM Linux loading approximates end of low memory via a
different method.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-05 13:23:59 +01:00
Keir Fraser 45f66e11cc xend: remove default NIC in qemu when no vif configured
Latest QEMU would add a NIC device by default, unless specify the
"-nic none". So end user still get a unusable NIC even no vif in the
config file.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2008-08-05 09:29:42 +01:00
Keir Fraser 33d021a978 xend: Fix handling of pci creation failure in device_create().
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-08-04 11:11:24 +01:00
Keir Fraser f6a15c6354 xm on xenapi: Enable 'xm pci-list' via Xen-API
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-08-04 11:11:02 +01:00
Keir Fraser ad67b382bb xend: fix finding pci capability
Xend doesn't start up on my laptop which has a PCI-CardBus bridge.
PCI-CardBus bridge device doesn't have a capability chain.
Also sanity checking of a capability chain.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-08-04 11:10:27 +01:00
Keir Fraser f06e832088 xm: fix up exception handling when spawning vnc viewer.
From: Ian Jackson <Ian.Jackson@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-04 11:06:31 +01:00
Keir Fraser f1b5be9017 xm on xenapi: Enable 'xm pci-{att,det}ach' commands to be executed via xen-api.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-31 13:31:15 +01:00
Keir Fraser fc57b9025f xm on xenapi: Add missing support for creating pci-assigned domains
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-07-31 13:30:59 +01:00
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