Commit Graph
3497 Commits
Author SHA1 Message Date
Keir Fraser ad86c7de55 xm: Allow detaching vif by MAC address
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-27 08:09:26 +00:00
Keir Fraser f0e8b55eb1 xm: Fix maxvcpus support
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-11-26 10:57:26 +00:00
Keir Fraser f9abceac96 xend: little fix for tap
Need get dev type after create tap device as device_create did.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>
2009-11-26 10:56:49 +00:00
Keir Fraser 68a94cf528 xm: Add maxvcpus support
this is patch to add maxvcpus support to xen xm command. It's using
vcpu_avail bitmask and sets the number of vcpus to maxvcpus if
present.  If it's not present, old behavior is preserved.

In domain config file you can define it as follows:

maxvcpus = 4
vcpus = 2

this automatically sets vcpus to 4 and corresponding bitmask to
present 2 vcpus in the guest with option to increase it up to 4
vcpus. If maxvcpus is not present, the old behavior for vcpus is
preserved, ie.  you can set vcpus to some number of vcpus to be used
and the vcpu_avail is set appropriately to use all of them. Only when
you use maxvcpus and vcpus new vcpu_avail value is calculated to show
PV guest the desired number of vcpus only.

It's been tested using RHEL-5 32-bit PV guest with maxvcpus = 4 and
vcpus = 2 and also the previous setup of vcpus = 2 only... In both
cases I was able to use 'xm vcpu-set {domainId} {numberOfVCPUs}' to
increase move vcpu count from 0 to maxvcpus/vcpus so it was working as
designed.

Signed-off-By: Michal Novotny<minovotn@redhat.com>
2009-11-25 14:11:02 +00:00
Keir Fraser 08a0b4ab0d Replace tsc_native config option with tsc_mode config option
(NOTE: pvrdtscp mode not finished yet, but all other
modes have been tested so sooner seemed better than
later to submit this fairly major patch so we can get
more mileage on it before next release.)

New tsc_mode config option supercedes tsc_native and
offers a more intelligent default and an additional
option for intelligent apps running on PV domains
("pvrdtscp").

For PV domains, default mode will determine if the initial
host has a "safe"** TSC (meaning it is always synchronized
across all physical CPUs).  If so, all domains will
execute all rdtsc instructions natively; if not,
all domains will emulate all rdtsc instructions but
providing the TSC hertz rate of the initial machine.
After being restored or live-migrated, all PV domains will
emulate all rdtsc instructions.  Hence, this default mode
guarantees correctness while providing native performance
in most conditions.

For PV domains, tsc_mode==1 will always emulate rdtsc
and tsc_mode==2 will never emulate rdtsc.  For tsc_mode==3,
rdtsc will never be emulated, but information is provided
through pvcpuid instructions and rdtscp instructions
so that an app can obtain "safe" pvclock-like TSC information
across save/restore and live migration. (Will be completed in
a follow-on patch.)

For HVM domains, the default mode and "always emulate"
mode do the same as tsc_native==0; the other two modes
do the same as tsc_native==1.  (HVM domains since 3.4
have implemented a tsc_mode=default-like functionality,
but also can preserve native TSC across save/restore
and live-migration IFF the initial and target machines
have a common TSC cycle rate.)

** All newer AMD machines, and Nehalem and future Intel
machines have "Invariant TSC"; many newer Intel machines
have "Constant TSC" and do not support deep-C sleep states;
these and all single-processor machines are "safe".

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-11-25 14:05:28 +00:00
Keir Fraser a9c7cc22db xend: pci: show error msg properly if pciback/pci-stub are not loaded
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-11-23 07:23:07 +00:00
Keir Fraser 0f761fab23 xend: Add support for XCP Windows PV drivers
This patch adds support for XCP Windows paravirtual drivers to run on
Xen. The drivers are currently provided in binary-only format from
Citrix. At a minimum, this patch is useful for performance comparisons
vs GPLPV drivers.

Live migration and save/resume are functional but set the guest clock
to the 1970's. The clock must be manually adjusted for the guest's ntp
to resume accurate timekeeping.

Before rebooting windows at the end of driver installation create the
registry key
HKLM\System\CurrentControlSet\Services\xenevtchn\Parameters. Add to it
a DWORD called SetFlags with a value of 0x10000000.

Signed-off-by: Keith Coleman <keith@scaltro.com>
2009-11-23 07:12:06 +00:00
Keir Fraser 998479ef8f Remus: remove Py_RETURN_NONE for Python 2.3
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:10:56 +00:00
Keir Fraser fa249f4edc Remus: fix a warning
This patch fixes the following warning:
  xen/lowlevel/checkpoint/libcheckpoint.c: In function
  `delete_suspend_timer':
  xen/lowlevel/checkpoint/libcheckpoint.c:352: warning: assignment
  makes integer from pointer without a cast

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:07:08 +00:00
Keir Fraser 1e4968503b xend: Remove tab indents
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-23 06:52:35 +00:00
Keir Fraser f60cd0f902 xend: Remove extraneous logging from pyxc_physinfo().
Also fixes 32-bit build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-14 10:25:19 +00:00
Keir Fraser f481a3f9c3 xend: Balloon down memory to achive enough DMA32 memory for PV guests
with PCI pass-through to succesfully launch.

If the user hasn't used dom0_mem=3D bootup parameter, the privileged
domain usurps all of the memory. During launch of PV guests with PCI
pass-through we ratchet down the memory for the privileged domain to
the required memory for the PV guest. However, for PV guests with PCI
pass-through we do not take into account that the PV guest is going to
swap its SWIOTLB memory for DMA32 memory - in fact, swap 64MB of
it. This patch balloon's down the privileged domain so that there are
64MB of DMA32 memory available.

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-14 08:09:50 +00:00
Keir Fraser 42b2352e01 xend: call xc_assign_device for all the devices to hotplug
this patch fixes a couple of issues with pci passthrough in xend,
previously reported by Cui Dexuan.
The main problem is that xc_assign_device is called only for the first
device hotplugged into the guest and not the followings.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 21:54:44 +00:00
Keir Fraser 04d6becec1 remus: Add missing python __init__.py file
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 21:09:33 +00:00
Keir Fraser 113d3d76a6 remus: Add missing unistd.h include from libcheckpoint.c
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 17:21:13 +00:00
Keir Fraser 1a38c03675 Remus: add python control extensions
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-13 15:33:37 +00:00
Keir Fraser f8a685ad57 A few trivial cleanups
Alphabetize object files and guest config options for better
readability. Also remove svm interrupt prototypes which do not
exist.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-11-12 11:42:02 +00:00
Keir Fraser a7cbf88f59 xend/xm: Add PSCSI_HBA class and DSCSI_HBA class to XenAPI
XenAPI (not xapi) has supported only LUN assignment mode for pvSCSI.
But at last, HOST assignment mode also is supported by these patches.
To support HOST assignment mode, these patches add PSCSI_HBA class
and DSCSI_HBA class to XenAPI.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-12 11:40:44 +00:00
Keir Fraser 85f5921bdf blktap2: add remus driver
Blktap2 port of remus disk driver. Backwards compatable with blktap1
implementation.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:45:06 +00:00
Keir Fraser 61e986758d Remus: Fixup for tap:tapdisk syntax in remus uname
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:41:16 +00:00
Keir Fraser ad91d3c17b Remus: Make checkpoint buffering HVM-aware
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:19:27 +00:00
Keir Fraser 13ffaa7d3d Remus: Make xc_domain_restore loop until the fd is closed.
The tail containing the final PFN table, VCPU contexts and
shared_info_page is buffered, then the read loop is restarted.
After the first pass, incoming pages are buffered until the next tail
is read, completing a new consistent checkpoint. At this point, the
memory changes are applied and the loop begins again. When the fd read
fails, the tail buffer is processed.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:14:03 +00:00
Keir Fraser cecb47b785 xen passthrough: fix recent regressions
This patch fixes the recent regressions pointed out by Dexuan, keeping
pci passthrough working with stubdom too.  In particular calling
device_create when pci_state == 'Initialising' is a mistake because
the state is always Initialising when attaching a device while
device_create has too be called only when the pci backend is missing.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-03 12:41:54 +00:00
Keir Fraser 26b39a0d63 xend: disallow ! as a sxp separator
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2009-10-28 10:59:55 +00:00
Keir Fraser 16d8dcbfb3 xend: Add keymap to vfb config for hvm guests
From: Jim Fehlig <jfehlig@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-27 12:52:14 +00:00
Keir Fraser 8fb16359d5 xend, passthrough: Small fix to find_all_the_multi_functions()
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-26 12:20:07 +00:00
Keir Fraser 5856aed296 blktap2: Fix sysfs handling of blktap2
The pause and unpause paths are currently broken due to a missing
slash. I took advantage of the opportunity to remove code repetition,
repeated strings that should point to the proper constants, etc

From: Andres Lagar Cavilla <andreslc@cs.toronto.edu>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-23 10:09:37 +01:00
Keir Fraser 0dba100da6 xsm: Add getenforce and setenforce functionality to tools
This patch exposes the getenforce and setenforce functionality for the
Flask XSM module.

Signed-off-by : Machon Gregory <mbgrego@tycho.ncsc.mil>
Signed-off-by : George S. Coker, II <gscoker@alpha.ncsc.mil>
2009-10-23 10:05:15 +01:00
Keir Fraser 545a227dfc passthrough/stubdom: clean up hypercall privilege checking
This patch adds securty checks for pci passthrough related hypercalls
to enforce that the current domain owns the resources that it is about
to remap. It also adds a call to xc_assign_device to xend and removes
the PRIVILEGED_STUBDOMS flags.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-23 10:04:03 +01:00
Keir Fraser 6d1d7ac48c xend: bootable flag of VBD not always of type int
1. Calling VDB.set_bootable(True) results in string 'True' in managed
   config file. After xend restart, conversion int(bootable) in
   server/blkif.py fails.
2. selection of bootable disks in XendDomainInfo.py requires
   type(bootable) == int not str, otherwise all disks are taken as
   bootable.

This patch converts the bootable flag always to int.

Signed-off-by: Lutz Dube <Lutz.Dube@ts.fujitsu.com>
2009-10-21 09:23:10 +01:00
Keir Fraser 2a03afa74d stubdom: implement pci coldplug
This patch fixes the circular dependency problem in the toolstack that
prevented pci coldplug from working with stubdoms: after creating the
stubdom we wait for it to be properly initialized before going
further. We release the domain lock while we wait.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-21 08:51:10 +01:00
Keir Fraser 1eb8140e5b Fix nomigrate option implementation so that Xen builds.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-20 10:23:28 +01:00
Keir Fraser 87cb99a6dd Add nomigrate config option to disable migration/restore
The new nomigrate option can be set to non-zero in vm.cfg
(for both hvm and pvm) to disallow a guest from being
migrated or restored.  (Save is still allowed for the purpose
of checkpointing.)  The option persists into a save file
and is also communicated into the hypervisor, the latter
for the purposes of a to-be-added hypercall for communicating
to guests that migration is disallowed (which will be
used initially for userland TSC-related sensing, but may
find other uses).

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-10-20 08:45:12 +01:00
Keir Fraser 5cee2dafd8 xend: Cast oos flag to int before arithmetic.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-20 08:43:27 +01:00
Keir Fraser 90abd2437a Per-domain switch to disable oos shadow page tables
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2009-10-19 10:55:46 +01:00
Keir Fraser d1c22b7f83 xm,xend: Add commands to hotplug usb devices to hvm guests
Signed-off-by: James Song Wei <jsong@novell.com>
2009-10-19 10:48:47 +01:00
Keir Fraser c288a6ff89 xm: Fix xm network2-{attach,detach}
"xm help" is aborted due to a missing comma.
Some fixes in passing.
- less help message.
- typo.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-10-19 10:47:09 +01:00
Keir Fraser 27759c390c xend: Implement VBD.media_change
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-16 09:04:53 +01:00
Keir Fraser 5a0730a435 xm: Use 'vifname' config option to construct a qemu tap name.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2009-10-16 08:36:22 +01:00
Keir Fraser dea1048d11 xend: Check no VBDs attached on VDI.destroy
We can destroy a VDI by VDI.destroy even if the VDI is being used
to VBDs. This patch checks that the VDI is not used to VBDs.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-16 08:35:21 +01:00
Keir Fraser 106c81c683 xm,xend: A few fixes for changeset 20314
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-16 08:32:34 +01:00
Keir Fraser 6edd9aaf78 xend: passthrough: do not check non-page-aligned MMIO BAR if not strict-check
When the option pci-passthrough-strict-check of
/etc/xen/xend-config.sxp is set to 'no', we don't check the
non-page-aligned MMIO BAR.  This could be useful in some cases, e.g.,
when there is only 1 device in the range of the page and we try to
assign the device to pv guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-10-16 08:30:13 +01:00
Keir Fraser 242a16c3d1 xend: add a description config item for each guest.
Add a new option "description=" to each VM to increase the
manageability of VM, which could be accessed via "xm list -l
MACHINE".e.g add "description='(name, james),(priority 5), (owner
james.song@company.com)'" to configure file, User can get the VM's
attribute easily by "xm list -l Machine" or some tools.

Signed-off-by: James Song<jsong@novell.com>
2009-10-16 08:24:47 +01:00
Keir Fraser f8e61527db xm: Reuse VDI if location is same
In XenAPI mode, when we start a VM by using xm create command, VDIs
are always automatically created for VBDs.  Once we shut down the
VM, then start the VM again, then VDIs are newly created.  As a
result, a vdi.xml file continues to expand.

This patch reuses VDIs if location of the VDIs is same.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-15 08:31:08 +01:00
Keir Fraser 51f36202c4 xend: destroy stubdoms synchronously
This patch makes the destruction of stubdoms a synchronous event,
therefore it is no longer possible to run out of memory when rebooting
a guest because the stubdom of the old guest is always destroyed
before the creation of the new guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-15 08:16:42 +01:00
Keir Fraser b1fd365cec xm,xend: Add new option "change_home_server" to xm migrate
This patch adds a new option to xm migrate command.  A concept of the
option is inspired from XenServer/XenCenter.  The concept is "Change
home server (affinity)."  The option name is "change_home_server."

Currently, a config.sxp file of a managed domain is not migrated to a
destination server even if the migration of the managed domain
succeeds.  The config.sxp file is kept in a source server.

By the patch, the config.sxp file is migrated with the managed domain.
The config.sxp file is unregistered from the source server, then the
config.sxp file is registered to the destination server.

BTW, should the config.sxp file be always migrated without the option?
If the managed domain is migrated without the option, the managed
domains exist on both the source server and the destination server.
(Of course, the managed domain on the source server is "halted" state,
and the managed domain on the destination server is "running" state.)
Is it good that the managed domains with a same UUID exist on both
servers?  (In the patch, I added the option for compatible.)

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-14 09:09:23 +01:00
Keir Fraser a45c214328 xend: call pci_device_configure on the stubdom
Whenever pci_device_configure is called on a guest that has a stubdom,
call pci_device_configure on the stubdom as well.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-14 08:56:55 +01:00
Keir Fraser 1ce3e83dc7 xend: allow a device to be assigned to a guest and its stubdom
This patch allows a pci device to be passed through an HVM guest and
its own stubdom at the same time.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-14 08:56:25 +01:00
Keir Fraser 2f42a37e57 xend: Fix VDI-VBD link for XenAPI
I detected problems of VDI-VBD link again.
  - In the case of inactive managed domains, VDI->VBD link was lost
    by xend restarting (or host OS rebooting).
  - In the case of active domains, both VDI->VBD link and VBD->VDI
    link were lost by xend restarting.

When xend is restarted, information of VDI instances is restored from
a vdi.xml file.  But the vdi.xml file does not have UUID of VBD
because xend does not write the UUID to the vdi.xml file.  Therefore,
VDI->VBD link is lost.  When xend is restarted, information of VBD
instances is restored from xenstore.  But xenstore does not have UUID
of VDI.  Therefore, VBD->VDI link is lost.

This patch solves the problems.  VDI instances stop having UUID of
VBD.  Instead, xend gathers UUID of VBD each time it's required.  The
method is the same as Network->VIF link.  Information of VBD instances
is restored not only from xenstore but from a config.sxp file.  UUID
of VDI is restored from the config.sxp file.

FYI, VBD->VDI link of inactive managed domains is not lost because
information of VBD instances is restored from the config.sxp file.
UUID of VDI is written by xend to the config.sxp file.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-09 08:56:43 +01:00
Keir Fraser d680037667 xend: Fix bug in superpage flag handling
During testing I discovered that using a bootloader magically clears
the superpage flag out of the config.  This small patch fixes that
behavior.

From: Dave McCracken <dcm@mccr.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-09 08:53:42 +01:00