Commit Graph
2515 Commits
Author SHA1 Message Date
Keir Fraser 2d700e03ef Revert 16973:b5427f2d83c3, which breaks automated testing (HVM qemu-dm
will not die when it is told to).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-05 23:27:12 +00:00
Keir Fraser ae9093a33f xend: Scrub vnc password for vfb from xend.log.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-05 10:40:10 +00:00
Keir Fraser 3ad6af357a xend: Restore values of /vm/uuid/xend/* to recreated domains.
When guest domains are restarted, previous values of /vm/uuid/xend/*
in xenstore are lost.  (e.g. previous_restart_time,
last_shutdown_reason). This patch restores them to restarting domains.
And we should update /vm/uuid/xend/restart_count of restarting
domains, not previous domains.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-02-05 10:39:35 +00:00
Keir Fraser 264f5caa68 ioemu: use SIGHUP instead of SIGKILL
The stub domain device model needs to trap the termination signal so
as to actually destroy the stub domain.  SIGKILL can't be trapped,
SIGTERM is caught by SDL and so may be unnoticed.  SIGHUP can be
trapped and is not caught by SDL (and by default causes a process
termination without core).

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-02-04 13:44:29 +00:00
Keir Fraser 7eec742d38 Revert 16963:d29d74d4eeac and 16750:2ac0fd9fd4b4.
Continue to SIGKILL qemu-dm so that 'xm destroy' should always work
rather than hang if qemu-dm is in a bad state.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-02-03 09:09:21 +00:00
Keir Fraser 48a61dfcea xend: Fix grow of the LEGACY_UNSUPPORTED_BY_XENAPI_CFG list each time
we instantiate a new XendConfig.
Signed-off-by: Pascal Bouchareine <pascal@gandi.net>
2008-02-02 10:53:24 +00:00
Keir Fraser 912c5a1f61 Fix save/restore failure cleanup
The save failure cleanup introduced in 13543:207523704fb1 is
incorrect: if we didn't get as far as actually suspending the domain,
then the guest domain will not be expecting the devices to be removed
(seen on both Linux and Solaris, which don't expect a 'Closing' state
when they hold the device open). Only re-jig devices if we definitely
shut the domain down.

Signed-off-by: John Levon <john.levon@sun.com>
2008-02-02 10:51:54 +00:00
Keir Fraser 6cc641c89f Direct Linux boot: XenD changes for HVM direct Linux boot.
This patch provides the tools support for direct kernel boot of
HVM guests. Currently the config files in /etc/xen support the
args  'kernel', 'ramdisk' and 'extra'. For PV guests these have
the obvious meaning.

Unfortunately HVM guest configs hijacked the 'kernel' parameter
and use it to refer to the path of the HVM firmware. So, this
patch adds a new config file parameter called 'loader' which is
used to refer to the HVM firmware instead.

The conventions for loading the initrd image say that it should
live at the end of memory. This requires QEMU to know the size
of the guest's initial RAM allocation, so image.py is changed
to pass the '-m' flag to QEMU.

The HVMImageHandler class in image.py is changed so that if the
'kernel', 'ramdisk' or 'extra' params were given in the config
these are passed to QEMU with the '-kernel', '-initrd' and
'-append' flags respectively.

Finally, the 'loader' param is used as the arg to 'xc_hvm_build'
instead of the old 'kernel' param.

For the sake of compatability with old HVM guest config files,
if the config file has a 'kernel' param whose path matches that
of the HVM firmware, then we automatically convert this 'kernel'
param into the 'loader' param. This ensures existing HVM guests
work without changes required.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2008-02-01 11:18:15 +00:00
Keir Fraser d113c0a940 Fix xm shutdown/reboot for HVM domain of IA64
xc.domain_destroy_hook() is called twice when we execute
xm shutdown/reboot command to an HVM domain without PV drivers.
The first calling is from shutdown() in XendDomainInfo.py.
The second calling is from destroyDomain() in XendDomainInfo.py.
The first calling is not necessary, so this patch removes it.

A discussion about this patch is as follows.
 http://lists.xensource.com/archives/html/xen-ia64-devel/2008-01/msg00232.html

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-01-31 09:43:05 +00:00
Keir Fraser 5fcfe68304 xend: fix external-device-migrate step 0
Add domain name to a migrateDevice call, so the helper script
(external-device-migrate example) does not fail at step 0
(MIGRATION_TEST).

Signed-off-by: Pascal Bouchareine <pascal@gandi.net>
2008-01-30 14:24:20 +00:00
Keir Fraser 17cbb242dc acm, xend: Fix resetting policy.
Fix a problem when resetting the policy and the label of Domain-0
needs to be renamed.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-01-30 14:23:17 +00:00
Keir Fraser a1d430b309 xend: Small fix for hvm/hap flags.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-01-30 09:38:10 +00:00
Keir Fraser 0f63bb058b xend: Perform uuid/name uniqueness check on restore.
From: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-30 09:35:49 +00:00
Keir Fraser 34d2cb5d8d xend: Fix building PV guests after introducing new HVM-HAP config option.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-29 15:16:35 +00:00
Keir Fraser 1ab2675b0c xend: Obey localtime config option for HVM guests as well as PV guests.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-29 15:15:51 +00:00
Keir Fraser e0979793ea x86, hvm: Add a per-domain parameter to specify shadow or hap.
Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
2008-01-29 13:46:16 +00:00
Keir Fraser be5fbf9a7f Move generation of public header hierarchy into the tools.
This patch merges the two versions of public header generation
currently used in the build into one.

Signed-off-by: Bastian Blank <waldi@debian.org>
2008-01-26 10:38:44 +00:00
Keir Fraser 2787b8a48d Fix leaking of /vm/<uuid> path in xenstore on various VM lifecycle events.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-01-25 13:29:51 +00:00
Keir Fraser 13b49a3763 Fix 'on_*=rename-restart' domain configuration option.
When setting e.g. 'on_crash=rename-restart' option in domain config
and crashing guest OS running in the domain, the new domain is
restarted with same name as renamed domain.

jfehlig4: # xm li
Name                                        ID   Mem VCPUs State Time(s)
Domain-0                                     0   1233   4  r----- 937.9
Domain-e64b12a0-0493-44d7-afde-55c776513426 21   384    1  ---c-  14.3
Domain-e64b12a0-0493-44d7-afde-55c776513426 22   384    1  r-----  7.3

This patch copies the domain info prior to setting new name and uuid
in the crashed domain info and uses the copied domain info to
construct the restarted domain.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-01-25 13:29:07 +00:00
Keir Fraser 961f9b1fc9 (Re)introduce notion of crashed VM power state.
The crashed power state is necessary to allow both core-dumping a
crashed but preserved VM and renaming/restarting a crashed VM.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-01-25 13:28:25 +00:00
Keir Fraser f9f9329313 New XS_SET_TARGET
Stubdomains (and probably other domain disagregation elements too)
need to be able to tinker with another domain.  This adds
XS_SET_TARGET so that XenStore allows domains to have permissions on
files on which the "target" has permissions.  This also adds
xs_set_target, called by the domain builder when the 'target' option
is used in the configuration.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-23 13:22:13 +00:00
Keir Fraser 47fcfcb75b New XEN_DOMCTL_set_target
Stubdomains (and probably other domain disagregation elements too)
need to be able to tinker with another domain.  This adds IS_PRIV_FOR
that extends IS_PRIV by allowing domains to have privileges over a
given "target" domain.  XEN_DOMCTL_set_target permits to set this
"target". A new 'target' configuration option makes the domain builder
use it.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-23 13:21:44 +00:00
Keir Fraser bf4b59a4c7 xend: On block-attach, remove device information when VmError occurs.
I tested xm block-attach command with a wrong
parameter(file:). Naturally a command error occurred. Then I retested
xm block-attach command with a correct parameter(phy:). But a command
error occurred again. The second command error occurred because Xend
did not remove device information from self.info when the first
command error occurred.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-01-22 09:51:49 +00:00
Keir Fraser 3e49205c7a xend: Handle unspecified timer_mode domain platform parameter.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-01-18 22:27:51 +00:00
Keir Fraser 52bbc0f440 qemu-dm: Nicely terminate the device model script, to let it properly
clean resources.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-01-18 13:35:05 +00:00
Keir Fraser ed8253e285 xm: Fix xm restore command.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-01-17 15:23:47 +00:00
Keir Fraser aac518b954 tools/docs: Fix example and default IP addresses.
In various places in documentation and code, IP addresses are provided
as examples, defaults, or dummy configuration.  In general the
specific IP addresses used in Xen are not always appropriate.  (For
example, 1.2.3.4 is used in a few places!)

The following addresses should be used:
 * For examples and documentation, 192.0.2.0/24.  (See RFC3330.)
 * For defaults for private networks, a random network from RFC1918.
   I have randomly selected 172.30.206.0/24 for this purpose and
   documented this in at the only registry I know of,
   www.ucam.org/cam-grin.  This network should henceforth be used for
   default configurations of local bridges, test networks, etc. in
   Xen tools.

The following addresses should NOT be used:
 * 10.0.*.*, 10.1.*.*, 192.168.0.*, 192.168.1.*, etc.  Using these
   addresses gives greatly increased likelihood of collision, as
   ignorant network administrators and reckless middlebox vendors
   often pick networks from the bottom of 10/8 and 192.168/16.
 * 169.254.*.*.  These are reserved for zeroconf (ad-hoc networking)
   and should not be used for Xen private networks, bridges, etc.,
   etc.  Use of these addresses by Xen scripts causes trouble on hosts
   (eg laptops) which find themselves in ad-hoc networking
   environments.  I think this is not hypothetical (!) since at least
   one Linux distribution have specific code to detect this case and
   cause Xen startup to fail iff the host already has an external
   zeroconf address.
 * 1.2.3.4.  WTF !?

I have also used 127.0.255.255 in one place where apparently a dummy
address is needed (some Linux kernels won't accept a lack of an NFS
server address).  If 127.0.255.255 is mistakenly used it is unlikely
to do any damage to real traffic even if it does escape into the
network at large.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-01-17 15:13:40 +00:00
Keir Fraser 49c14d4312 xend: Remove hardcoded (and apparently unused) xend version.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-01-15 14:24:05 +00:00
Keir Fraser ecd285a056 [Xend] Fix 2 problems related to SR class
This fixes two problems related to the SR class:
- get_PBDs() was not implemented
- get_physical_size did not work

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-01-08 09:54:06 +00:00
Keir Fraser 819571016f Fix xend xenstore handling.
xend can get into a situation where two processes are attempting to
interact with the xenstore socket, with disastrous results. Fix the
two bad users of xstransact, add a big warning, and fix the destructor
so future mistakes will be detected earlier.

Signed-off-by: John Levon <john.levon@sun.com>
2007-12-27 12:27:34 +00:00
Keir Fraser 1f7f827c82 Xend: don't check for device reuse if the device has no uname.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2007-12-20 13:48:27 +00:00
Keir Fraser 53f48ca221 Fix some build system error handling.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2007-12-20 13:16:21 +00:00
Keir Fraser f28baafaaf xend: Fix device duplicate check.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2007-12-19 14:51:02 +00:00
Keir Fraser add89911d2 xend: Fix PCI Device Configuration
Xend doesn't correctly work after restart, when there is a domU which
owns a pci device (driver domain). This patch fixes the problem.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2007-12-19 14:50:37 +00:00
Keir Fraser 2578655c64 xend: Indicate a resume operation
Indicate that the domain is created as part of a resume operation
rather than a 'create'.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-19 14:45:04 +00:00
Keir Fraser 9d379685d6 xend: Prevent XenD touching externally managed bridges
With current XenD 3.0.4 or later try the following:

    brctl addbr demo
    ifconfig demo up

    /etc/init.d/xend start
    /etc/init.d/xend stop

    ifconfig demo down
    brctl delbr demo

Now, start XenD again....

    /etc/init.d/xend start

And watch in horror as it re-creates your 'demo' bridge.

The problem is that the 'XendNetwork' class does not distinguish
between bridge devices that it is managing (ie those created via
XenAPI) and those which it does not manage (ie those created by OS
distro init scripts, or by apps like  libvirt).

While initially I thought I could just make XenD ignore
externally-managed bridges completely, it seems to needs to know about
them otherwise it can't hook up guest VIFs to them correctly. So the
attached patch adds a 'managed' flag to the XendNetwork
class. Externally managed bridges have this set to False. At startup
XenD will now only re-create bridge devices which have the 'managed'
flag set to 'True'  - ie those created via XenAPI.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2007-12-15 18:26:52 +00:00
Keir Fraser 80197aaf42 acm, xend: Serialize the execution of external scripts.
Instead of starting a thread per script, run a single thread and send
orders to it. This serializes the execution of the scripts.

Signed-off-by: Stefan Berger <stefanB@us.ibm.com>
2007-12-14 10:26:11 +00:00
Keir Fraser 8b1031d446 xsm: Implement missing functions in XSM dummy module
I am implementing some missing interface functions in the XSM dummy
module. Also deactivating some debugging output.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-14 10:17:50 +00:00
Keir Fraser 891143e321 tools: Some fixes for 'make clean'.
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
2007-12-14 10:16:52 +00:00
Keir Fraser 239ad70fb2 vt-d: Test device assignability in xend, but defer actual assignment to qemu-dm.
Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-12-12 10:29:35 +00:00
Keir Fraser 05fcdea668 ia64, xend: Close nvram file when rebooting HVM domain
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-12-12 10:08:54 +00:00
Keir Fraser 1a0a31cbc6 xend: Fix cleanup_domains() for suspending managed domains
When unmanaged domains with on_xend_stop="suspend" exist, managed
domains are not suspended by xend stop command.  The processing of
cleanup_domains() is aborted by exception. This patch keeps suspending
managed domains even if unmanaged domains exist.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-12-12 10:08:14 +00:00
Keir Fraser c3711577c1 tools: Fix distutils installation of xsview.
Distutils won't install xsview unless it has an __init__.py.  This
patch adds an empty one, which is all that is required.

Signed-off-by: Mark Williamson <mark.williamson@cl.cam.ac.uk>
2007-12-12 10:05:53 +00:00
Keir Fraser 9b64cdda45 tools: Use os.system instead of exec to start xentop.
This makes no difference to the visible behaviour of "xm top" but
avoids the whole of xm from quitting if you're in "xm shell".  This
provides the more intuitive behaviour of returning to the xm shell
interface after leaving xm top.

Signed-off-by: Mark Williamson <mark.williamson@cl.cam.ac.uk>
2007-12-12 10:04:29 +00:00
Keir Fraser 012e2baf87 tools: Remove references to USB paravirt driver. Doesn't affect qemu usb args.
Some relics in the control tools still refer to the USB paravirt
driver.  Remove this as it's dead code and is in the history for
anyone really interested. The Qemu device model has its own USB
configuration, which should still work.

Signed-off-by: Mark Williamson <mark.williamson@cl.cam.ac.uk>
2007-12-12 10:03:32 +00:00
Keir Fraser 7d6b2ecfac xend, acm: Extend Xen-API with function to reset the policy
This patch extends the Xen-API and the legacy XML-RPC interface with a
function to reset the policy on the system (through an update with the
default policy). I adapted the code in 'xm resetpolicy' to use this
now.

This patch also extends libxen and the documentation to reflect the
new function.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-12 09:57:55 +00:00
Keir Fraser db9563e7e4 xm: Fix help messages of xm vcpu-list/uptime
We can give multiple domains to the following commands.
But, the help messages of the commands are explained to be able
to give a single domain.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-12-07 12:44:27 +00:00
Keir Fraser 8fd28ec7bd ACM: Recover if XML policy representation is missing.
Recover the system if the XML representation of the currently loaded
policy is missing. Force the installation of the DEFAULT policy.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-12-06 12:13:12 +00:00
Keir Fraser 7408fe8337 xm: Fix help message of xm info.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-12-05 10:40:19 +00:00
Keir Fraser 45be668f9f Fix help message of on_xend_stop
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-12-05 09:57:32 +00:00