Commit Graph
2654 Commits
Author SHA1 Message Date
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
Keir Fraser 72c4148247 xm: Fix formatting of xm block-list output.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-06-05 10:31:17 +01:00
Keir Fraser cea190c247 Fix blkif.py for virsh start
I defined a cdrom to a guest domain as follows.

  ",hdc:cdrom,r"

When the guest domain was created by using xm create command, uname
of the cdrom was ''.  Then creating the guest domain succeeded.

[2008-06-03 15:23:41 xend.XendDomainInfo 25956] DEBUG
(XendDomainInfo:200)
XendDomainInfo.create(['vm', ['name', 'rhel5.2ga_hvm_lvol1'],
<<snip>>
['device', ['vbd', ['uname', ''], ['dev', 'hdc:cdrom'], ['mode',
'r']]],
<<snip>>

But, when the guest domain was created by using virsh start command,
uname of the cdrom was None.  Then creating the guest domain failed.

[2008-06-03 15:22:10 xend.XendDomainInfo 25559] DEBUG
(XendDomainInfo:200)
XendDomainInfo.create(['vm', ['name', 'rhel5.2ga_hvm_lvol1'],
<<snip>>
['device', ['vbd', ['dev', 'hdc:cdrom'], ['mode', 'r']]],
<<snip>>

This patch fixes to be able to create guest domains by both xm create
command and virsh start command.

FYI:
"if uname is None:" --> "if uname == '':" --> "if not uname:"
   till CS#17625             current           by this patch

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-06-05 10:30:29 +01:00
Keir Fraser 85745512c5 xend: implement VM_hard_reboot of XenAPI.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-06-03 09:33:41 +01:00
Keir Fraser 8a41cd8573 xend: Add node parameter to do_migrate() for HTTP interface
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-29 13:38:31 +01:00
Keir Fraser 491c0ade25 iommu: Handle sibling device assignment correctly
Domctl interface is extended to allow libxc retrieve device group
information from hypervisor. Vendor-specific iommu_ops is also
extended by adding a new operation "get_device_group_id()", which is
currently a null pointer but could be implemented later for vt-d.

Error will be raised from tools side when user trying to assign PCI
device with a sibling device being driven by dom0. User will keep
being prompted until he has hidden the entire device group (at least,
the sibling devices driven by dom0) in dom0 kernel
parameter. Hopefully this framework could be flexible enough to
support both amd iommu and vt-d.

The following 2 cases are not covered by this patch, but should be
easy to handle.
* Checking for hot-plug devices (maybe we can delay calling
ImageHandler.signalDeviceModel() until all checks are done?)
* Checking for splitted device group between different passthru
domains

Signed-off-by: Wei Wang <wei.wang2@amd.com>
2008-05-28 14:41:23 +01:00
Keir Fraser 863d18e20d Revert 17731:eafb252f141.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-27 11:50:43 +01:00
Keir Fraser 91df8a74b6 xend: fix a typo in domain_migrate().
- @rtype:  ->  @type node:

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-27 10:31:55 +01:00
Keir Fraser 3ebb3ee816 xend: add a reset button to Web interface.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-27 10:31:25 +01:00
Keir Fraser 056f122d52 xend: take care of dead qemu-dm process
This patch fix xend as when fatal error happened (e.g. qemu-dm process
was killed) log error message then mark that domain as crashed, do
what specified on crashed in the domain config file. Added some code in
xend to check those crashed hvm DM status each 30 seconds.

Signed-off-by: Xiaowei Hu <xiaowei.hu@oracle.com>
2008-05-26 08:53:25 +01:00
Keir Fraser 11b6a5dbe0 Fix XendAPI VM_migrate parameters
This patch removes unused resource parameter and fixes the default
value for domain_migrate. Also removes tab indent in XendOptions.py.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2008-05-26 08:26:37 +01:00
Keir Fraser a9f43ccc9e Handle IOMMU device assignment for PV guests
Added more informative error codes for device assignment domctls.
Introduced python bindings for device assignment and enable xend to
also perform IOMMU device assignment when assigning PCI devices.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
2008-05-24 09:45:37 +01:00
Keir Fraser 407c970b52 xend: Import TRIGGER_S3RESUME and HVM_PARAM_ACPI_S_STATE into XendDomain.py.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-23 10:57:03 +01:00
Keir Fraser eea031f921 Add -s --ssl option to xm migrate
This patch adds -s --ssl option to xm migrate. It will override
xend-relocation-ssl setting in /etc/xen/xend-config.sxp.

When mix deploy xen 3.2 and xen 3.3 servers, it's convenient to have a
command line option rather than modify /etc/xen/xend-config.sxp every
time.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2008-05-23 10:42:11 +01:00
Keir Fraser d6f7e230eb Make ssl relocation server listen on different port
This patch makes ssl relocation server listen on 8003 if enabled.

Whether to start ssl relocation server now controlled by
xend-relocation-ssl-server. So ssl and non-ssl relocation server can
run simultaneously. You can also only start ssl server or only start
non-ssl relocation server.

When mix deploy xen 3.2 server (has no ssl support) and 3.3 servers,
start ssl and non-ssl relocation server simultaneously can keep
backward compatibility.

It's also more reasonable to have separate ports for ssl and non-ssl.

In this patch, also renames xend-relocation-tls to xend-relocation-ssl.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2008-05-23 10:41:44 +01:00
Keir Fraser 45ea543412 xend: fix automatic vcpu NUMA placement
The automatic NUMA placement code (find_relaxed_node) in
XendDomainInfo.py contains several bugs:
1. The domain just created shall not be considered in the load
calculation.
2. Nodes with too less memory for the domain must be considered during
the load calculation phase and abandoned later, currently these nodes
win with a load of 0.
3. CPUs which are offline shall not be considered in load calculation.
4. (Integer-)Dividing the load value by the number of cores per node
may conceal subtle load differences resulting in a non-optimal node to
be chosen.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2008-05-22 15:11:06 +01:00
Keir Fraser da61293b33 xend: Remove XendLogging dependency from a couple of generally useful
support modules.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2008-05-21 10:57:08 +01:00
Keir Fraser 306921aa6f xend: Support HVM S3 resume.
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Ke Liping <liping.ke@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-05-20 14:50:45 +01:00
Keir Fraser 4f050d52f5 xend: Fix bugzilla bug #1253.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-20 14:18:32 +01:00
Keir Fraser 07a57a397e xm migrate: Better error report when attempt to migrate non-running domain.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-20 09:43:02 +01:00
Keir Fraser a7b0dfd0b3 Fix showing of CPU Affinity by xm vcpu-list
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-05-19 09:46:02 +01:00
Keir Fraser b93de169c3 xend: Device configurations of suspended virtual machines are inaccessible
The device configurations of suspended virtual machines are
inaccessible even though for example the UUIDs of the VIFs and VBDs
are known and returned when VM.get_VIFs()/get_VBDs() is called, though
when trying to access their records for example, then handle is
reported as being invalid. This patch fixes this.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-05-15 16:40:51 +01:00
Keir Fraser a295f2a1c6 ia64: fix domain restore
A domain fails to restore on IA64 since cset 17524:18727843db60.
This patch fixes it temporarily. Guest CPUID configuration for IA64
might be implemented in the future.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-05-14 13:25:19 +01:00
Keir Fraser 09951b66a6 xend: fix block protocol mismatch on save/restore
The protocol field of the blkif interface is correct at startup for a
guest of a different mode from dom0 (eg. 32-bit dom0, 64-bit guest).
However, this property is not persisted on save, so a later restore
(or migrate) will setup the block interface with the wrong mode.

Signed-off-by: Herbert van den Bergh <herbert.van.den.bergh@oracle.com>
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
2008-05-14 09:19:05 +01:00
Keir Fraser 04cd40bbf6 [Xend/security] Refactor the code that recalculates the label during a policy update
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-05-13 12:46:45 +01:00
Keir Fraser ef6666a9b0 Xend: Fix blkif type check for tap devices.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-05-13 12:43:24 +01:00
Keir Fraser 8a588ca061 Fix guest boot if set empty cdrom in config file
This is because function "uname = config.get('uname', '')" returns '',
rather than None, if uname is not in config variable.

Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
2008-05-13 10:19:54 +01:00
Keir Fraser be2dc0b642 XM/XenAPI: Add cdrom support when creating domains by xm through Xen API.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-05-13 09:48:55 +01:00
Keir Fraser 61341026d9 XM/XenAPI: Add blktap support when creating domains by xm through Xen API.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2008-05-13 09:48:40 +01:00