Commit Graph
2774 Commits
Author SHA1 Message Date
Keir Fraser b526733e2f xm: Improve xm error if booted native
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2009-02-04 11:58:25 +00:00
Keir Fraser 14e9431629 XendAPIStore - do not remove non-existent item
If list is searched and item not found, then don't attempt to delete
the item.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2009-02-04 11:57:17 +00:00
Keir Fraser fa5078d407 stubdom: add videoram to stubdom initial memory reservation
This patch adds a videoram parameter (4MB is the default) to pv guests
too: if the pv guest is actually a stubdomain then the videoram size
is added to the initial required available memory.
This way there is no risk that a stubdom fails to populate the
videoram because the RAM freed for the videoram by dom0 has already
been used to create the stubdom.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-01-29 16:41:48 +00:00
Keir Fraser 597edba986 xend: Fix block device type check
Since changeset 17617 the block device protocols are checked to be
either file or phy. This has later been fixed to also include
tap. This is still not a correct check as there can be arbitrary
additional protocols. Before this check was added you could have a
block-xyz hotplug script and xyz would work as a protocol, now it is
refused. An example for this mechanism is the block-nbd script which
is included in the tree.

This patch changes the check to allow file, phy, tap and all protocol
names for which a block-$protocol hotplug script exists. This should
fix the last regressions introduced by the check.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
2009-01-29 16:39:56 +00:00
Keir Fraser ea75815bab xend: Fix do_FLR() scope problem.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-01-22 11:07:32 +00:00
Keir Fraser a390e6128b x86, hvm: stdvga improvements
* enables linear framebuffer and VBE 3.0 extensions.
* add a number of new resolutions, up to 2560x1600, and including
* widescreen modes common to modern displays.
* Introduce configurable video ram size through the "videoram" config
* file option, shrinking default video ram used to 4 Megs (thus
* eliminating 4 wasted megs/VM that have been the case until now), but
* allowing users to specify up to 16 Megs of vram, to support the
* extreme high resolutions such as 2560x1600x32.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-01-14 10:51:58 +00:00
Keir Fraser 47cee35ef0 xend: fix ballooning bug
c/s 18960 introduced a bug when xend balloons memory. The function
balloon.free requires a reference to a XendDomainInfo object, which is
missing in one call of this function. Attached patch fixes this. Also
replaced the variable name "self" in the (classless) function with
something more descriptive.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Reported-by: Maik Hentsche <maik.hentsche@amd.com>
2009-01-13 15:29:06 +00:00
Keir Fraser 9f8501582f Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything.  This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/.  Specifically:
 * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
 * Remove -Wp,-MD... from every other Makefile
 * Remove setting of DEPS from every other Makefile
 * Ensure that every Makefile says -include $(DEPS)
 * Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP.  The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:16:05 +00:00
Keir Fraser a562362b25 xend: Fix a ssl migration hang issue
When another VM is started by xend, the spawned qemu process will keep
the p2cwrite file descriptor open.
Thus there will be two open descriptors associated with the write end
of the pipe. The read end of the pipe only sees EOF when the qemu
process has terminated.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2009-01-09 10:04:24 +00:00
Keir Fraser ad8b20cc85 x86, hvm: Move E820 table creation into hvmloader, extend
hvm_info_table to describe memory parameters in a simpler form from
domain builder to hvmloader.

Also move reserved special page mappings immediately below the 4GB
boundary.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 15:27:20 +00:00
Keir Fraser 85eff2ee28 xm: Fix syntax error.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-01-08 15:18:30 +00:00
Keir Fraser f86db27518 pci: add config options for MSI-INTx translation in HVM
Add a config file option 'pci_msitranslate' to enable MSI-INTx
translation in HVM, and also a per-device option 'msitranslate' to
allow device base to be overridden

Signed-off-by: Qing He <qing.he@intel.com>
2009-01-08 11:26:58 +00:00
Keir Fraser 925d7f9d82 pci: add pci option support for XenAPI sever
Allow the per-device options for passthrough pci devices
This patch is for XenAPI server

A new key-value pair element of 'pci' named 'pci_opt' is added
to xml config file

Signed-off-by: Qing He <qing.he@intel.com>
2009-01-08 11:26:16 +00:00
Keir Fraser 925b2ca585 pci: add pci option support for XML-RPC server
Allow the per-device options for passthrough pci devices
for exmaple, in domain config file:
    pci = ['01:00.0,opt1=val1,opt2=val2', '01:00.1' ]
or in the PCI hotplug case:
    xm pci-attach -o opt1=val1 --options=opt2=val2 <domid> 01:00.0 6

This patch is for xml-rpc server

Signed-off-by: Qing He <qing.he@intel.com>
2009-01-08 11:25:43 +00:00
Keir Fraser 15c5bb9f92 xend: Fix error handling in device_create().
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-01-06 14:01:39 +00:00
Keir Fraser dca0b1a805 vtd hotplug: check if a device can be hot-plugged.
When we statically assign a pci device (the pci=3D['xx:xx.x'] string
in guest config file) to guest, we make many checkings (for instance,
if the device is specified in 'pciback.hide', if it has
non-page-aligned MMIO BARs, if it has a proper FLR capability, if the
related devices should be co-assigned). However, with respect to the
guest hotplug, we only check if the device exists and not assigned yet
-- this is not enough, for instance, now xend allows us to assign an
in-use device (being used by Dom0) to an HVM guest (because
xc.test_assigned() returns OK) -- this will cause disaster... The
patch adds some necessary checkings.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-01-05 11:14:18 +00:00
Keir Fraser 5bbed21d17 PoD memory 9/9: xend integration
Xend integration for PoD functionality.
* Add python bindings for xc_hvm_domain_build() and
xc_domain_memory_set_pod_target()
* Always call xc_hvm_domain_build(), with memsize = memory_static_max
and target=memory_dynamic_max
* When setting a new memory target:
 + First make sure we actually have enough free memory for the target
setting to succeed
 + Call set_pod_target() with the new target, to Xen can do the Right
 Thing.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-01-05 10:47:03 +00:00
Keir Fraser 1e5e52220f xend: Actually restrict a domU's access to xenstore when we mean to --
this means that in some cases it cannot be owner of its own xenstore
nodes.

This bug was pointed out by Daniel Berrange at Red Hat. This patch is
my own more generic fix that automatically covers a range of callers
(albeit the patch is arguably a bit of a hack ;-).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-18 17:18:28 +00:00
Keir Fraser 6ac1537ba7 tools: Fix a few error-path memory leaks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-09 12:53:19 +00:00
Keir Fraser b90edb337d xend: Remember bootable flag for vbds in xenstore
When xend is restarted, bootable flags of all disk devices are lost
and then the first disk is marked as bootable by a "compatibility
hack". When a guest domain is created with a mixture of several vbd
and tap devices, the compatibility hack may fail to choose the right
bootable device. Thus preventing the guest to be restarted. This patch
fixes this behavior by remembering bootable flag for each disk device
in xenstore database.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2008-12-09 12:45:45 +00:00
Keir Fraser ce4d300de0 xend: Fix memory allocation bug after hvm reboot in numa system
Recently we find a bug on Nahelem machine (totally with two nodes, 6G
memory (3G in each node):
- Start a HVM guest with its all VCPUS pinned to node1, so all its
memory is allocated from node1.
- Reboot the HVM.
- There will be some memory allocated from node0 even there is enough
free memory on node1.

Reason: For security issues, xen will not put all the pages of a dying
hvm to domheap directly, but put them in scrub list and wait for handled
by page_scrub_softirq(). If the dying hvm have a lot of memory,
page_scrub_softirq() will not handle all of them before the start the
hvm. There are some pages belong to node1 still in scrub list, new hvm
can't use pages in it. So this hvm will get different memory
distribution than before. Before changeset 18304, page_scrub_softirq()
can be excuted parallel between all the cpus. Changeset 18305
serialise page_scrub_softirq() and Changeset 18307 serialise
page_scrub_softirq() with a new lock to avoid holding up acquiring
page_scrub_lock in free_domheap_pages(). Those changeset slow the ability
to handle pages in scrub list. So the bug becomes more obvious after.

Patch: This patch modifiers balloon.free to avoid this bug. After
patch, balloon.free will check whether current machine is a numa
system and the new created hvm has all its vcpus in the same node. If
all the conditions above fit, we will wait until all the pages in
scrub list are freed (if waiting time go beyond 20s, we will stop
waiting it.).

This seems to be too restricted at the first glance. We used to only
wait for the free memory size of pinned node is bigger than
required. But as we know HVM memory alloction granularity is 2M. Even
the former condition is satisfied, we still may not find enough
2M-size memory on that node.

Signed-off-by: Ting Zhou <ting.g.zhou@intel.com>
Signed-off-by: Xiaowei Yang <Xiaowei.yang@intel.com>
2008-12-09 12:44:32 +00:00
Keir Fraser a046a6dc89 Fix domain save when guest is in S3.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-12-05 15:54:22 +00:00
Keir Fraser 69dff7d532 xm: Fix xm block-list for inactive managed domains
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-12-04 11:32:43 +00:00
Keir Fraser e7a89ddbf9 xend: Remember bootloader settings in xenstore
When xend is restarted, bootloader settings of all running domains are
lost. The attached patches fixes this by saving bootloader and
bootloader_args to xenstore database.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2008-12-04 11:31:37 +00:00
Keir Fraser c4e83a1484 xend: Fix device release for tap devices
I saw an error message when I shut down a domain.  The error
message showed that release of device(vbd/51712) failed.  But the
device was tap, was not vbd.  I think that a cause of the error message is
because _releaseDevices() calls destroyDevice() by wrong device class.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-11-28 13:05:58 +00:00
Keir Fraser 2fdd853ff5 xm: Relax the sanity check on guest configuration with XSM-ACM addlabel
The attached patch relaxes the sanity check on guest configuration
when assigning a acm label to the guest. This patch makes a guest
configuration accept a bootloader parameter. This is common for
paravirtualized guests to boot them by using pygrub.

Signed-off-by: INAKOSHI Hiroya <inakoshi.hiroya@jp.fujitsu.com>
2008-11-28 13:04:30 +00:00
Keir Fraser 71a732a2b8 PCI interface changes for PCIE-AER enabling
This patch reflects some pci interface changes in pciif.h in XEN head
file. And also add domain shutdown support in xend for shutting domain
from DOM0 kernel when non-recoverable uncorrected pci error happens.

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Ke Liping <liping.ke@intel.com>
2008-11-24 11:06:16 +00:00
Keir Fraser ed2dbb7a0f xend: Make _setCPUAffinity() errors nonfatal on domain resume
This patch allows domains to be resumed on different number of CPUs. After
c/s 18764, a domain cannot be resumed when _setCPUAffinity() fails, which
happens when affinity should be set to a non-existent CPU. This patch
makes _setCPUAffinity() errors nonfatal.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2008-11-20 14:17:09 +00:00
Keir Fraser c014d5785e xenapi: fix valid_object typo
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2008-11-20 14:14:20 +00:00
Keir Fraser 336c683373 tools: use sysfs interface to balloon driver if present
The pvops dom0 kernel does not expose the balloon driver via
/proc/xen, so use the sysfs interface.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2008-11-17 15:54:31 +00:00
Keir Fraser 541e42472a Fix to save CPU affinity for xm save/restore
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-11-14 14:27:51 +00:00
Keir Fraser 3c66521c46 xm: display domain id on domain creation
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2008-11-13 10:50:50 +00:00
Keir Fraser ac1e2634bc xend, pciif: fix some indentation
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-11-12 11:50:25 +00:00
Keir Fraser 21f2630b0f xend: Restore CPU affinity on domain resume.
Move affinity-setting logic into its own function and call from
relevant places.

From: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-11-11 11:06:27 +00:00
Keir Fraser 9d2a3ef6e8 xend, security: Prevent changing of the policy while VMs are migrating
The net changes of this patch are that the reader-side lock is put
into the path of the migration code and the writer lock into the path
of the code that handles the changing of the policy. Simultaneous
migrations of multiple hosts still work after this lock has been added.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-11-05 10:23:26 +00:00
Keir Fraser 4b5d0b9cfb xend: Add a multi-reader-single-writer lock implementation
This patch adds a reader-writer lock primitive to xend since python
does not provide it by default. The implementation is based on a
condition variable. Some test code is appended at the end of the file.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2008-11-05 10:22:19 +00:00
Keir Fraser 9cec91aba5 xend: ioport & irq persistence thru reboot
When a domU is configured for a serial port as documented at:
   http://wiki.xensource.com/xenwiki/InstallationNotes

the VM does see the serial port, however when dom0 is rebooted and
the VM started it no longer has access to the serial port.

xm list -l <vm> no longer shows the ioports or irq attributes

Attached patch adds implementation of getDeviceConfiguration(),
returns details dict and implements waitForDevice() to irqif.py and
iopif.py.

Also added preprocess_irq() to create.py.

Signed-off-by: Pat Campbell <plc@novell.com>
2008-11-03 10:23:09 +00:00
Keir Fraser 4b88a787b3 xend: Fix typo in waitForBackend() for phantom VBDs
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-10-28 10:37:30 +00:00
Keir Fraser 416b905545 Fix xm scsi-attach/detach/list for inactive managed domains
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-10-27 10:03:17 +00:00
Keir Fraser 0de77ea0ad xend: Fix and clean up vscsi_util.py and other files
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2008-10-21 11:43:21 +01:00
Keir Fraser 81d08745ba xend: fix setting vcpus > VCPUs_max
From reading xend code related to changing number of vcpus it appears
setting the number of vcpus to a value greater than VCPUs_max is not
allowed on a running domain.  This restriction is not honored by
setVCpuCount() in XendDomainInfo.py.  Attached patch makes
setVCpuCount() fail if vcpus > VCPUs_max and domain is running.

Also, I think the changes should be reflected in managed config of
running domain if in fact the domain is managed - so unconditionally
call managed_config_save().

BTW, the original code is rather confusing.  Essentially the same
actions are taken regardless if self.info['VCPUs_max'] > vcpus, just
the order of invocation is changed.  But this doesn't seem to matter
since self.info['VCPUs_live'] is not subsequently used.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-10-20 15:17:24 +01:00
Keir Fraser 66e8c0272e xend: Stub out vscsi_get_scsidevices() until issues are addressed.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-10-20 15:05:48 +01:00
Keir Fraser 44a6b9e6d4 Enhance XenAPI for pvSCSI
Basically, I implemented XenAPI for pvSCSI according to the patch of
XenAPI document which I sent before.  However, I renamed the class
name of virtual SCSI devices to "DSCSI".

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-10-16 09:50:18 +01:00
Keir Fraser 39407bed9c x86: make injection of spurious page faults configurable per domain
Some distro kernels do not handle spurious page faults so allow these
to be supressed on a per VM basis.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2008-10-15 15:56:26 +01:00
Keir Fraser 5e58cce9f7 hvm: Battery Management virtual firmware and toolstack changes
Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
2008-10-14 11:08:15 +01:00
Keir Fraser 39f97ffa29 x86, hvm: Hyper-V guest interface support with small set of enlightenments
A minimal implementation of the Viridian (Hyper-V) guest
interface. The only enlightenments advertised and supported are vAPIC
MSRs and long-spin-wait notifications. The set of enlightenments can
easily be extended in future, as they are found to provide a
performance win, and configured via an extended HVM_PARAM_VIRIDIAN hvm
parameter.

Signed-off-by: Peter Johnston <peter.johnston@citrix.com>
Signed-off-by: Tim Deegan <tim.deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-10-14 10:45:29 +01:00
Keir Fraser 7e3496ba25 xend: fixup the Secondary Bus Reset.
Use the read-modify-write operation.
Change the wrong 'I' to a correct 'H'.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-10-13 10:08:36 +01:00
Keir Fraser 27b182400b xend: Fix dev backend path construction.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2008-10-13 10:03:36 +01:00
Keir Fraser d0fedc8895 xend: Restore bridge control register after secondary bus reset
From: Chris Dalton <cid@hp.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-10-10 11:52:26 +01:00
Keir Fraser de07008fdd xend: Fix the detection of the upmost bridge in the python function find_parent().
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-10-10 10:03:28 +01:00