Commit Graph
2873 Commits
Author SHA1 Message Date
Keir Fraser 00f3705554 xend: Do not overwrite xauthority and display with empty values
Display and xauthority vars are read from vmConfig['platform'] first,
then they are read again from dev_info.
However if the user does not set those variable in the config file,
dev_info won't contain them, hence we are going to overwrite the
current significant values with null.
This patch fixes the problem setting display and xauthority to the
current values if dev_info does not contain them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-04-23 10:09:16 +01:00
Keir Fraser da27f6d8b7 stubdoms: generate stubdom config file
This patch removes the need for a second configuration file for
stubdoms: it is going to be automatically generated by the script
stubdom-dm using command line options and xenstore to find any needed
information.
The configuration script will be placed under /etc/xen/stubdoms and
automatically removed when the domain is destroyed.
The only change needed in xend is not to write on xenstore sdl,
opengl and serial command line options for qemu, because stubdoms do
not support them.
It is safe to remove those two options from xenstore because qemu does
not use xenstore to read commans line options.
Finally this patch fixes blkfront disconnections from backends and
display and xauthority variables for pv guests.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-04-23 10:08:04 +01:00
Keir Fraser c6c343f888 xend: The method union_update on a set was renamed to update in Python 2.3
From: Ruben Kerkhof <ruben@rubenkerkhof.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-04-20 13:48:31 +01:00
Keir Fraser 9d09f146c9 xend: clean up qemu-dm related items on domain destroy
Some qemu-dm related stuffs might be left behind after the domain is
destroyed.
 - xenstore entry, /local/domain/0/device-model/<domid>
 - named pipes, /var/run/tap/qemu-{read,write}-<domid>

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-17 13:04:47 +01:00
Keir Fraser 19c624b57a xend: serialise domain restart threads
I observed from xend.log that several domain restart threads run
simultaneously. This patch make it singleton.
Without this, several coredump of a domain might be created.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-15 11:25:07 +01:00
Keir Fraser b158b87dbe xend: fix avoidance to restart domain on crash
If a qemu-dm dies immediately (probably by wrong setting),
xend repeats to restart a domain so many times.=20
That causes system overload.

There is already a logic to avoid too early restarting, however,
it might not work. Since xenstore entry 'xend/previous_restart_time'
is volatile. XendDomainInfo.destroy() which removes the entry from
xenstore is called in some places.

Also, this patch prevents too early restarting even at the first
domain creation.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-15 11:23:02 +01:00
Keir Fraser da31cad930 xend: Fix xm pci-attach/detach for inactive managed domains
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-04-09 11:35:14 +01:00
Keir Fraser 710cd6ce97 xend: fix a typo in pciif so PciController.unwatchAerState() works
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-09 08:45:32 +01:00
Keir Fraser 11e1149fe0 tools: Always use sane upstream (`native') python paths
Previously, by default we would install our python modules into
/usr/lib/python/xen, for example /usr/lib/python/xen/__init__.py.
Upstream python's standard install location (a) includes the Python
version number and (b) puts things in site-packages by default.

Our best conjecture for the reason for this was an attempt to make the
installs portable between different python versions.  However, that
doesn't work because compiled python modules (.pyc), and C python
extensions corresponding to one version of python, are not compatible
across different versions of python.

This is why upstream include the version number.

site-packages is the standard location for locally-installed packages
and is automatically included on the python search path.

In this change, we abandon our own unusual python path setup:

 * Invoke setup.py in an entirely standard manner.  We pass
   PREFIX and DESTDIR using the appropriate options provided by
   setup.py for those purposes (adding them to setup.py calls
   which were previously lacking them).

 * Since the installation locations are now on the standard
   python path, we no longer need to add anything to the path
   in any of our python utilities.  Therefore remove all that
   code from every python script.  (Many of these scripts
   unconditionally added /usr/lib/python and /usr/lib64/python which
   is wrong even in the old world.)

 * There is no longer any special `Xen python path'.  xen-python-path
   is no longer needed.  It is no longer called by anything in our
   tree.  However since out-of-tree callers may still invoke it, we
   retain it.  It now prints a fixed string referring to a directory
   which does not to exist; callers (who use it to augment their
   python path) will thus add a nonexistent directory to their python
   path which is harmless.

 * Remove various workarounds including use of setup.py --home
   (which is intended for something completely different).

 * Remove tests for the XEN_PYTHON_NATIVE_INSTALL build-time
   environment variable.  The new behaviour is the behaviour which we
   should have had if this variable had been set.  That is, it is now
   as if this variable was always set but also bugs in the resulting
   install have been fixed.

This should be a proper fix for the bug addressed by c/s 19515.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-04-08 19:13:04 +01:00
Keir Fraser ed85358827 xend: Give domain-ID 0 to xc.test_assign_device
When xend calls xc.test_assign_device, xend does not have to give
the domain-ID of a guest domain.
This patch gives domain-ID 0 to xc.test_assign_device.

The following methods give domain-ID 0 to xc.test_assign_device
currently.
 - setupDevice@xend/server/pciif.py
 - pciinfo@xend/XendNode.py

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-04-08 10:18:31 +01:00
Keir Fraser bd5e620a8b xend: fix c/s 19510
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-04-08 09:02:22 +01:00
Keir Fraser ca01c742be tools: fix python installation
attached patch lets python install the modules into
DESTDIR/PREFIX as before, but lets python search
the modules in PREFIX rather DESTDIR/PREFIX.

This prevents failures about not finding python modules
after files have been installed into PREFIX.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-04-07 14:37:35 +01:00
Keir Fraser bf70c78677 xm: handle error in auxbin gracefully
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-04-07 14:24:53 +01:00
Keir Fraser b8f2311b23 xm, xend: Replace "vslt" with "vslot"
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-04-07 10:15:25 +01:00
Keir Fraser 94bacaf76d xend: fix leak of /local/domain/* in xenstore
xenwatch thread _storeChanged() may create /local/domain/<domid>
entries in xenstore even after the domain has shutdown.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-07 10:14:35 +01:00
Keir Fraser b812d1ddc4 xend: Use AUTO_PHP_SLOT where it ought to be
Signed-off-by: Simon Horman <horms@vereg.net.au>
2009-04-06 13:49:59 +01:00
Keir Fraser 1847d666d1 xm: allow space characters in a vscsi definition.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-04-02 12:40:44 +01:00
Keir Fraser ab438874b6 hvm: add ACPI power button for HVM
This patch adds the ACPI fixed hardware power button for HVM.
It enables a graceful shutdown of a guest OS by direction of Dom0.
(if a proper action for the power button is set inside the guest)

usage:
  xm trigger <Domain> power

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-02 12:40:09 +01:00
Keir Fraser db8811093e xend: Revert c/s 19436 -- fails with Python 2.3, and sock.close()
should suffice to shutdown a connection.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-04-01 13:17:34 +01:00
Keir Fraser eed32b0cbd xend: modify a warning log message
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-01 11:47:59 +01:00
Keir Fraser 8e558b0e97 xend: fix rtc_timeoffset when localtime=1
The rtc_timeoffset parameter in VM config is ignored when
localtime=1. Also it is not preserved across reboot.

NOTE:
This patch changes the meaning of the xenstore
/vm/<uuid>/rtc/timeoffset
from utc offset to local offset. (it's OK for the ioemu)

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-04-01 11:47:25 +01:00
Keir Fraser 37307651ac xend: Balloon 4MB memory slop when creating a domain
I've found some problems when running 2 guests with and then trying
to install a new machine (no matter whether using virt-manager or
virt-install).

Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-04-01 11:46:31 +01:00
Keir Fraser c9a16ee02d xend: Set close-on-exec flag for datagram sockets
We need to close the socket on the child side when xend creates a
child process such as qemu-dm.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-04-01 11:45:22 +01:00
Keir Fraser c6d5b4e310 xend: allow hvm domain to have multiple serial consoles
This patch allows hvm domain to have multiple serial ports
with serial =3D [ '...', '...'].
The old style, serial=3D'option string', is also accepted for
compatibility.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-04-01 11:44:49 +01:00
Keir Fraser 0a690b0314 acm: Restrict the XML of the policy to only allow one
SimpleTypeEnforcementType node.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2009-04-01 11:44:10 +01:00
Keir Fraser 2fa8c71b9f xend: Fix domain creation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-31 13:57:11 +01:00
Keir Fraser 98da66a3bd build: Get rid of some more hardcoded install paths
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-31 13:30:50 +01:00
Keir Fraser f94d6532fc xend: less noise in xend-debug.log on HVM shutdown
Shutting down a hvm, xend-debug.log always shows:

Unhandled exception in thread started by=20
Traceback (most recent call last):
  File "//usr/lib64/python/xen/xend/image.py", line 549, in
  _sentinel_watch
    self._dmfailed(message)
  File "//usr/lib64/python/xen/xend/image.py", line 491, in _dmfailed
    xc.domain_shutdown(self.vm.getDomid(), DOMAIN_CRASH)
xen.lowlevel.xc.Error: (3, 'No such process')

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-03-31 13:20:04 +01:00
Keir Fraser 55ec31da6c xend: Check for valid CPU_CAP value when creating new domain
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-31 13:19:07 +01:00
Keir Fraser f02c18fff7 xend: Return True from device_update when cfg_xenapi
When device_update is called by using cfg_xenapi, this patch
returns True.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-31 11:49:56 +01:00
Keir Fraser 9e7c906ffa XenAPI: Implement {get,set}_auto_power_on
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-31 11:48:07 +01:00
Keir Fraser 7fdd501f11 xend: Allow user to specify vslots 0 - 1f for static pass-through
The current parser only accepts vslots 0 - f (hex), that is, only
slots that have one digit. This is an omission as two digit slots
with a leading 0 or 1 are also valid, representing the
full range of slots 0 - 1f.

Thanks to Dexuan Cui for spotting this problem.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-31 11:40:28 +01:00
Keir Fraser c9e8655cb7 xenapi: Fix VDI:read_only, VDI:sharable and VBD:mode of XenAPI
I started a VM by using xm create, then I checked values of VDI
records and values of VBD records.  When I gave the following disk
modes to a disk parameter, I got the following values from the records.

               "r"    "w"    "w!"
VDI:read_only  True   True   True   <-- Always True!
VDI:sharable   True   True   True   <-- Always True!
VBD:mode       RO     RW     RO
                             ^^  <-- It should be RW.

This patch fixes the values of the records as follows.

               "r"    "w"    "w!"
VDI:read_only  True   False  False
VDI:sharable   False  False  True
VBD:mode       RO     RW     RW

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-31 11:31:08 +01:00
Keir Fraser e32808cc9c xend: fix hotplug for integrated devices
For integrated devices(with bus number 0), self.find_parent() returns
None, causing a python exception here.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-03-31 11:29:53 +01:00
Keir Fraser d81fe9d33a xend: Accept udev events about SCSI and update physical SCSI information
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-31 11:28:49 +01:00
Keir Fraser 75f6b53ab0 xend: Fix 'xm pci_list_assignable_devices'
The current implementation of 'xm pci-list-assignable-devices' command
has a problem that it directly invokes hypercall using
xen.lowlevel.xc.
This is probably based on an assumption that the command is executed
on the host itself, but in fact there are cases xm commands can be
executed on a remote server through xmlrpc.
So this patch makes the xm command just inquire of xend about the
information of available devices.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-31 11:28:08 +01:00
Keir Fraser 23d864769a xend: Fix scsi_id for pvSCSI
pvSCSI allocations fail if the version of udev in a host OS is
relatively new.  I have not been able to detect the failure because
I have used udev of the version 095.  The failure occurs by
an incompatibility problem of scsi_id command included udev.
This patch tackles the incompatibility problem.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-31 11:27:10 +01:00
Keir Fraser ea3ee2e615 xend: Allow drbd disks.
From: Ben Timby <btimby@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-31 11:26:10 +01:00
Keir Fraser 14f5ee16c8 xend: Supply pass-through vslot to qemu-dm
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-31 11:24:13 +01:00
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