Commit Graph
2834 Commits
Author SHA1 Message Date
Keir Fraser ceb97ddf1c xend: Properly save/restore vnc/vfb configuration
In 19284:0942BAA2A088 provision was made for running vnc and sdl
simultaneously.  However, arrangements for saving and restoring the
new structure-configuration, and arrangements for allowing the new
code to load old savefiles, were not made.

This patch adds these facilities.  Amongst other things, HVM VNC
save/restore will now work properly again.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-03-31 11:23:38 +01:00
Keir Fraser f32b5caf31 xend: Save the state of PPCIs after hot-plug events.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-31 11:16:01 +01:00
Keir Fraser be01c537b2 xend: fix domain_migrate
When the guest(pv-on-hvm guest that cannot suspend) reboot in
LiveMigration, the disconnecting of src-side is not transmitted to
dist-side. As a result, the error processing on the dist side is not
executed.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
2009-03-31 11:13:56 +01:00
Keir Fraser 92f9c55a94 xend: Disallow bogus MAC addresses when creating new VIF devices
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-03-31 11:12:39 +01:00
Keir Fraser 5534b7d986 xend: specify the slot for pass-through devices
Currently a slot may be specified for a hot-plug device,
but not for a pass-through device that is inserted at boot time.
This patch adds support for the latter.

The syntax is:
     BUS:DEV.FUNC[@VSLOT]
e.g: 0000:00:1d:0@7

This may be important as recent changes that allow any free PCI
slot to be used for pass-through (and hotplug) may case pass-through
devices to be assigned in different locations to before. Amongst
other things, specifying the slot will allow users to move them
back, if there is a need.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-20 12:09:20 +00:00
Keir Fraser e8f30212b1 xend: fix vscsi error path
Fix xend start problem on non-Linux Dom0 where /proc/mount doesn't exist.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-20 08:42:59 +00:00
Keir Fraser 0456ddb432 Disable xen platform PCI device when xen_platform_pci=0 is specified
- Change guest firmware to use new fixed byte port 0x10.
 - Add "xen_platform_pci" option into guest config file and APIs.
    xen_platform_pci=0: Disable xen platform device.
    xen_platform_pci=1: Enable xen platform device. (default)
 - Add "disable_pf" entry into xenstore.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2009-03-18 11:37:59 +00:00
Keir Fraser 84b150afdb xend: Fix vscsi assignment when XenAPI is available
When XenAPI is available, xm scsi-attach fails.  Also xm new and
xm create fail if a vscsi parameter is defined into domain
configuration files.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-18 11:34:20 +00:00
Keir Fraser 34bbd7a252 xend: Use vnc-listen setting specified in xend config file
If domU frame buffer configuration has no vnclisten attribute set, use
the global vnc-listen address specified in xend configuration file
when updating vfb location.  Currently the hardcoded value 'localhost'
is used.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2009-03-18 11:32:46 +00:00
Keir Fraser 063dd0319a xend: Add s3_integrity attribute for XenAPI
When XenAPI is available, xm new and xm create fail.

# xm new vm1
Using config file "/etc/xen/vm1".
Attribute 's3_integrity' not declared
# xm create vm1
Using config file "/etc/xen/vm1".
Attribute 's3_integrity' not declared

This patch adds an s3_integrity into create.dtd.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-17 10:49:42 +00:00
Keir Fraser 33548d1102 xend: Use AUTO_PHP_SLOT_STR=0xff rather than 0x0 for auto pci allocation
Rather than use "0x0" to signify that the hotplug slot should
be automatically selected by qemu-dm, define AUTO_PHP_SLOT_STR.

At the same time, change the magic value form 0x0 to 0xff,
in line with changes made to qemu-dm to allow any unused PCI
device to be used for hotplug.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-17 10:42:32 +00:00
Keir Fraser 27db6136ea xend: Accept udev events and update physical resource information
When a udev event is received, udevevent.py parses the udev data and
tells XendNode.py to update the physical resource information.
This patch also add a boolean parameter 'xend-udev-event-server', to
let users indicate whether we should enable this function or not.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-17 10:40:47 +00:00
Keir Fraser c48d2caadd xend: Add lock for lspci_info in pci.py
Add lspci_info_lock to protect lspci_info.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-17 10:37:12 +00:00
Keir Fraser 90797ec872 xend: Add lock for xen-api class instances in XendAPIStore.py
Add __classes_lock to protect __classes, since it can be modified by
the udev listener thread.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-17 10:36:51 +00:00
Keir Fraser c48f8a0105 xend: Implement DGRAM (connectionless) type socket listeners
Introduce SocketDgramListener and UnixDgramListener classes.
We already have STREAM (connection) type socket listener classes in
the source tree, but we need DGRAM (connectionless) type listeners to
receive udev events.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-17 10:36:20 +00:00
Keir Fraser b82b238521 xend: Fix xm scsi-attach for host OS without lsscsi
In the case of a host OS without lsscsi command, xm scsi-attach
command fails even if you specify existing SCSI device.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-13 07:38:47 +00:00
Keir Fraser 5fedaf9ef7 xend: Fix domain core-dumping about reset option
This patch moves a call processing of a domain reset processing
from xm to xend.  Also, it adds a reset argument to do_dump() of
SrvDomain.py.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-13 07:38:05 +00:00
Keir Fraser 8b173f5236 blktapctrl: Select backend by prefix
This patch adds support for specifying the backend (tapdisk or ioemu)
to blktapctrl. Images can be specified e.g. as tap:tapdisk:aio,
tap:ioemu:qcow2 or tap:vmdk. When omitting the backend, a default is
chosen based on the image type (currently always tapdisk because ioemu
as a backend is broken until a follow-up patch series against qemu-xen
is applied)

Signed-off-by: Kevin Wolf <kwolf@suse.de>
2009-03-12 18:42:31 +00:00
Keir Fraser 6dde5f55da xend: fix regression in c/s 19330
attached patch fixes a regression in c/s 19330 which
prevents to start guests on a Linux Dom0.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-12 15:40:52 +00:00
Keir Fraser 0aef8a0311 xend: Fix removing /vm/UUID/device paths when device cannot be disconnected
This is a corrected version of a patch commited as c/s 19250 and
reverted by c/s 19314. Thanks to "trap sigerr ERR" in
xen-hotplug-common.sh the xen-hotplug-cleanup would exit when reading
/local/domain/ID/vm fails thus skipping all the xenstore-rm lines in
the rest of the script.

Change deviceDestroy behavior to remove /vm/UUID/device/...
path only when force was used (as it already does so for both frontend
and backend) and do the removing from xen-hotplug-cleanup script when
we are sure the device is really not attached to the guest any more.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2009-03-12 15:08:08 +00:00
Keir Fraser 7caeec9358 xend: Use parse_hex() in XendPPCI.py
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-12 11:33:35 +00:00
Keir Fraser 0dc8a04b2b xend: Do not create XendNetwork instance of tmpbridge
This patch prevents xend from creating a XendNetwork instance of
tmpbridge (a temporary bridge used in network-bridge script).

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-12 11:33:06 +00:00
Keir Fraser 2ab3db9aae Fix xenstore permissions for Solaris domUs.
Solaris domUs use hvmpv/ and guest/ frontend xenstore directories.

Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 11:14:22 +00:00
Keir Fraser fb0a30b839 Domain core-dumping fixes
The code was attempting to use the domain's current number of pages
(info.nr_pages) as a maximum index.  We then walk the memory map and
can easily over-write past the end of the nr_pages-sized array, if the
domain has more pages mapped in than earlier (live dump).  Restrict
ourselves to the current number of pages.

Also fix the dump core method in xend to actually implement the crash
and live options.  In particular this means that xend clients other
than xm now get non-live dumps by default.

Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 11:09:57 +00:00
Keir Fraser 51494c8651 xend: Skip tap pipe creation on Solaris
Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 11:08:45 +00:00
Keir Fraser d88a38225c xend: Crash the domain if qemu-dm stops running
The comment about the lack of restart prevention is not accurate.

Bump the minimum restart time to 60 seconds.

Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 11:07:34 +00:00
Keir Fraser 43a12c170e Fix qemu spawn for Solaris
On Solaris, xend runs in a 'process contract' such that all children
are killed when the service is restarted.  Spawn qemu processes in a
new contract to avoid this.

Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 11:07:00 +00:00
Keir Fraser eb10d0f954 xend: Allow replacement of a cdrom device on a device_add
When adding a device, allow a cd to replace another if the device is a
cdrom.

Signed-off by: Ryan Scott <ryan.scott@sun.com>
2009-03-12 11:01:25 +00:00
Keir Fraser e36d0b0d06 xend: Time-out if guest fails to suspend
If a guest fails to re-write control/shutdown node within a minute,
fail the suspend operation.

Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 11:00:52 +00:00
Keir Fraser f87a6848fc xend: Allow off-line NIC removal
Match a MAC address so device_destroy can remove off-line NICs.

Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 10:59:53 +00:00
Keir Fraser 7865c25877 xend: Correctly catch invalid domain lookups
If a client asks about a non-existent domain, report the error back
properly instead of just backtracing within xend.

Signed-off-by: John Levon <john.levon@sun.com>
2009-03-12 10:59:19 +00:00
Keir Fraser 75c9ba7911 xend: Add support for cpuinfo data on Solaris
Signed-off-by: Russell Blaine <russell.blaine@sun.com>
2009-03-12 10:57:44 +00:00
Keir Fraser ff54f62e43 Revert c/s 19250, as it seems to be causing problems.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-12 08:32:30 +00:00
Keir Fraser e57bcd97a3 vscsi: Fix changeset 19310.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-11 13:11:21 +00:00
Keir Fraser ce205e72b5 xend: Discard error messages of lsscsi
In the case of a host OS without lsscsi command, the following
error message is recorded into xend-debug.log when xend is started.
The error message is recorded once certainly.  If SCSI devices are
connected to the host OS, it is recorded to the number of SCSI
devices.

  sh: lsscsi: command not found

This patch discards the error message to /dev/null.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-11 10:14:33 +00:00
Keir Fraser 0b384c185a xm: Sort pvSCSI devices information by virtual HCTL
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-11 10:13:46 +00:00
Keir Fraser 106e7dd3a9 xend: Test tap devices in testDeviceComplete()
XendDomainInfo.testDeviceComplete() should check block devices have
shutdown correctly but it only considers vbd class devices and ignores
tap devices. The attached patch changes testDeviceComplete() to wait
for both vbd and tap devices to be shutdown correctly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2009-03-11 10:10:15 +00:00
Keir Fraser 8591975c24 pvscsi: Some fixes for xm scsi-attach
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-09 09:49:50 +00:00
Keir Fraser 3ba7d233c7 xend: allow VM configuration with both sdl=1 and vnc=1
In the stubdom case you can now specify sdl=1 and vnc=1 (again, both
can be selected at the same time) in the vfb configuration.
So instead of:

vfb = [ 'type=vnc' ]

now you have:

vfb = [ 'vnc=1,sdl=1' ]

the former configuration option is deprecated but still supported for
backward compatibility.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-03-06 19:13:23 +00:00
Keir Fraser f3cc74d2f1 tool: make management of PCI D-states by guest optional
D3hot state in some PCI devices causes the failure of domain
creation/destruction.

The default is "pci_power_mgmt=3D0" which disables the guest OS from
managing D-states because it would be better to avoid the trouble than
advantage of low power consumption.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-03-06 18:58:41 +00:00
Keir Fraser 6976476d8c xend: Handle missing s3_integrity value, default to zero.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-05 17:50:05 +00:00
Keir Fraser eea1a2ea39 xend: blkif hda regexp fix
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-03-05 15:10:17 +00:00
Keir Fraser 8aaf870611 txt: Xen per-domain S3 integrity config
This patch adds a per-domain flag to specify whether a domain will be
S3 integrity protected when Xen is launched using tboot/TXT.

The tools now support an integer domain configuration parameter called
's3_integrity', which defaults to 1, to enable S3 integrity protection.

The struct arch_domain structure has been extended to have an
's3_integrity' field that represents this setting.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-03 11:52:44 +00:00
Keir Fraser 7fabf1409c xend: Make /var/lib/xen if not already present.
Signed-off-by: Christoph Egger <christoph.egger@amd.com>
2009-03-03 11:37:31 +00:00
Keir Fraser 8e3feb5145 xend: Fix removing /vm/UUID/device paths when device cannot be disconnected
Change deviceDestroy behavior to remove /vm/UUID/device/...
path only when force was used (as it already does so for both frontend
and backend) and do the removing from xen-hotplug-cleanup script when we
are sure the device is really not attached to the guest any more.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2009-03-02 10:34:37 +00:00
Keir Fraser 69e8ef7314 acm: Return a valid buffer
This patch reverts a previous patch trying to fix a memory, even
though I don't think there was any. Now return a valid buffer. All
functions calling this function do free the buffer.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2009-03-02 10:31:16 +00:00
Keir Fraser ec9db49cf0 xend: Fix some mistakes in tools/python/xend/util/pci.py
1) PCI_PM_CTRL_NO_SOFT_RESET: this is bit3 of PMCSR(Power Management
Control/Status). It should be 8. This bit means a device's capability
of not doing an internal reset across D3hot/D0.
If the bit is 1, there shall be no reset across D3hot/D0, so we should
not use it as a method to reset device.
2) When performing reset using standard FLR methods, we should sleep
at least 100ms; in current code, it's incorrect somewhere we sleep
0.2s and somewhere 0.01s.
3) In detect_dev_info(), fix a typo: PCI_EXP_TYPE_PCI_BRIDG ->
PCI_EXP_FLAGS_TYPE.
4) fix a small typo in the comment of transform_list().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-03-02 10:23:50 +00:00
Keir Fraser 5b0d675696 xend: Don't forget backend domain definitions for pvSCSI
Backend domain definitions for pvSCSI are forgotten.
This patch correctly handles them.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-02 10:22:23 +00:00
Keir Fraser 755c7136fe xend: Fix exception in pci_convert_sxp_to_dict()
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-02-19 11:07:33 +00:00
Keir Fraser b35b1efb72 xm: Some fixes for pvSCSI
For xm create and xm new, an error may not occur even if wrong
vscsi configuration is given.

e.g.
  vscsi = [ '0:0:0:0,0:0:0:0', '0:0:0:0,1:0:0:0' ]

  # xm create vm1
  Using config file "/etc/xen/vm1".
  Started domain vm1 (id=8)
  # xm scsi-list vm1
  Idx BE  state host  phy-hctl   phy   vir-hctl   devstate
  0   0   1     0     0:0:0:0    sda   0:0:0:0    None
  1   0   1     0     0:0:0:0    sda   1:0:0:0    None

This patch fixes some problems such as the above.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-02-19 11:01:15 +00:00