Commit Graph
7508 Commits
Author SHA1 Message Date
Keir Fraser adaedafa56 xsm: Change format strings from signed to unsigned
...to reflect the variables being passed in.

Signed-off-by : Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
2009-11-23 07:16:23 +00:00
Keir Fraser 41c532e4e5 libxc: Minor tools bzip2/lzma decompression fixes
The attached patch cleans up a few minor problems in the bzip2/lzma
decompression support, pointed out by Jiri in internal review.  In
particular, it fixes a possible memory leak on realloc() error, it
fixes a shifting typo, and it changes the xc_dom_printf()'s to be a
bit clearly about which compression routine is in-use.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-11-23 07:13:59 +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 558a4ade15 libxenlight: fix compilation error for ia64
xc_cpuid_apply_policy() and HVM_PARAM_VIRIDIAN are defined on x86
only.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:06:39 +00:00
Keir Fraser 22af01be29 [IA64] Remus: ia64 counter part of 07f6d9047af4
This patch adds callbacks to xc_domain_save().

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:06:10 +00:00
Keir Fraser cbc97d570c libxenlight: fix memory leaks
In particular:

- all the temporary flexarrays allocated in the create
  device functions must be freed;

- all the strings that don't need to be modified can be added as they
  are
  to these temporary flexarrays instead of duplicating them;

- any data returned to the user shouldn't be added to the global
  memory tracker so that the user can free it whenever he wishes.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-23 07:04:54 +00:00
Keir Fraser 2a9c410269 libxenlight: check for early failures of qemu-dm
This patch makes xl create check whether qemu-dm has started
correctly, and causes it to fail immediately with appropriate errors
if not.  There are other bugfixes too.

More specifically:

 * libxl_create_device_model forks twice rather than once so that the
   process which calls libxl does not end up being the actual parent
   of qemu.  That avoids the need for the qemu-dm process to be reaped
   at some indefinite time in the future.

 * The first fork generates an intermediate process which is
   responsible for writing the qemu-dm pid to xenstore and then merely
   waits to collect and report on qemu-dm's exit status during
   startup.  New arguments to libxl_create_device_model allow the
   preservation of its pid so that a later call can check whether the
   startup is successful.

 * The core of this functionality (the double fork, waitpid, signal
   handling and so forth) is abstracted away into a new facility
   libxl_spawn_... in libxl_exec.c.

Consequential changes:

 * libxl_wait_for_device_model now takes a callback function parameter
   which is called repeatedly in the loop iteration and allows the
   caller to abort the wait.

 * libxl_exec no longer calls fork; there is a new libxl_fork.

 * There is a hook to override waitpid, which will be necessary for
   some callers.

Remaining problems and other issues I noticed or we found:

 * The error handling is rather inconsistent still and lacking in
   places.

 * destroy_device_model can kill random dom0 processes (!)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2009-11-23 07:01:51 +00:00
Keir Fraser af7af769b9 libxenlight: correct broken osdeps.[ch] and make #includes consistent
osdeps.[hc] previously mistakenly declared and defined [v]asprintf.
These functions are available in the libc on most platforms.  Also,
osdeps.h is used by xc.c but xc.c is not part of the library, so
osdeps.h is part of the public interface and should have a better
name.

So now, instead:

 * osdeps.h is libxl_osdeps.h.

 * _GNU_SOURCE is #defined in libxl_osdeps.h so that we get the system
   [v]asprintf (and various other functions)

 * libxl_osdeps.h is included first in every libxl*.c file (it needs
   to be before any system headers so that _GNU_SOURCE) takes effect.

 * osdeps.[hc] only provide their own reimplementation of [v]asprintf
   if NEED_OWN_ASPRINTF is defined.  Currently it is not ever defined
   but this is provided for any platform which needs it.

 * While I was editing the #includes in each .c file, I put them all
   into the same order: "libxl_osdeps.h", then system headers,
   then local headers.

 * xs.h is included in libxl.h.  This is needed for "bool"; it has to
   not be typedefed in libxl.h because otherwise we get a duplicate
   definition when including xs.h.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-11-23 07:00:08 +00:00
Keir Fraser c14ce8a125 libxenlight: Clean up logging arrangements
* Introduce new variants of the logging functions which include
  errno values (converted using strerror) in the messages passed to
  the
  application's logging callback.

* Use the new errno-including logging functions everywhere where
  appropriate.  In general, xc_... functions return errno values or 0;
  xs_... functions return 0 or -1 (or some such) setting errno.

* When libxl_xs_get_dompath fails, do not treat it as an allocation
  error.  It isn't: it usually means xenstored failed.

* Remove many spurious \n's from log messages.  (The applications log
  callback is expected to add a \n if it wants to do that, so libxl's
  logging functions should be passed strings without \n.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2009-11-23 06:59:06 +00:00
Keir Fraser 93e6c4731d libxenlight: implement support for pv guests
This patch makes pv guest work correctly with libxenlight.  It also
implements support for vfb and vkbd, starting qemu in xenpv mode. Both
xenconsole and qemu are supported as console backends.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-23 06:54:03 +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 f38a18594b rombios: don't busy-wait for keystrokes
Spinning waiting for the keyboard is a bit rude on a virtual
machine. Wait for an interrupt instead.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-11-23 06:47:29 +00:00
Keir Fraser f1fa336b59 blktap2: fix libgcrypt detection
If we want to check the functionality of libgcrypt, we shouldn't test
a function only exported by openssl, but instead the one actually used
in the code.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-11-23 06:42:12 +00:00
Keir Fraser d3c3f9f893 blktap2: Remove uninitialised variable rc from tdremus_close().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-17 08:05:52 +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 3695303ba1 xsm: Dynamic update to device ocontexts
Added the ability to add and delete ocontexts dynamically on a running
system.  Two new commands have been added to the xsm hypercall, add
and delete ocontext.  Twelve new library functions have been
implemented that use the hypercall commands to label and unlabel
pirqs, PCI devices, I/O ports and memory.  The base policy has been
updated so dom0 has the ability to use the hypercall commands by
default.  Items added to the list will not be present next time the
system reloads.  They will need to be added to the static policy.

Signed-off-by : George Coker <gscoker@alpha.ncsc.mil>
Signed-off-by : Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
2009-11-13 22:00:19 +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 74781fed8b remus: Fix makefiles for indentation
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 17:02:25 +00:00
Keir Fraser b1a4f45a56 Remus: support for network buffering
This currently relies on the third-party IMQ patch (linuximq.net)
being present in dom0. The plan is to replace this with a direct hook
into netback eventually.

This patch includes a pared-down and patched copy of ebtables to
install IMQ on a VIF.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-13 15:34:46 +00:00
Keir Fraser 25f52c4c74 Remus: add control script to activate remus on a VM
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-13 15:34:03 +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 b0a1af6167 libxenlight: implement pci passthrough
This patch implements pci passthrough (hotplug and coldplug) in
libxenlight, it also adds three new commands to xl: pci-attach,
pci-detach and pci-list.
Currently flr on a device is done writing to
/sys/bus/pci/drivers/pciback/do_flr
pciback do_flr is present in both XCI and XCP 2.6.27 kernels.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 15:31:16 +00:00
Keir Fraser 35c1498503 libxenlight: fix name to domid conversion
This patch makes sure that the domain name to domid conversion is
correct, cross referencing the information found on xenstore with the
list of running domains.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 15:30:24 +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 000e0c8420 blktap2: Remove gnu89-inline option from CFLAGS
Not supported by older versions of gcc.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-11 13:11:44 +00:00
Keir Fraser 66cc31ec35 tools: Make build again on netbsd
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-10 13:01:09 +00:00
Keir Fraser 88069bda2e libxl: Call to open() must specify mode with O_CREAT.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-09 22:41:23 +00:00
Keir Fraser c5c301ac77 libxenlight: initial libxenlight implementation under tools/libxl
Signed-off-by: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-09 19:54:28 +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 ab8fdd95a1 blktap2: only open driver stack once
Currently blktap2 opens a driver stack, closes it, and re-opens
it. This causes problems with our remus driver: the primary may
connect to the backup in between the first and second open.

This is a temporary fix.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-11-09 19:40:48 +00:00
Keir Fraser 8b0f1cdb96 blktap2: configurable driver chains
Blktap2 allows block device drivers to be layered to create more
advanced virtual block devices. However, composing a layered driver is
not exposed to the user. This patch fixes this, and allows the user to
explicitly specify a driver chain when starting a tapdisk process,
using the pipe character ('|') to explicitly seperate layers in a
blktap2 configuration string.

for example, the command:
  ~$ tapdisk2 -n "log:|aio:/path/to/file.img"
will create a blktap2 device where read and write requests are passed
to the 'log' driver, then forwarded to the 'aio' driver.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-11-09 19:40:14 +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 2cdf23dd60 Remus: Do bitmap scan word-by-word before bit-by-bit.
For sparse bitmaps and large domains this saves a lot of time.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:17:22 +00:00
Keir Fraser 69ebc5d595 Remus: Do not bother with to_skip/to_fix bitmaps after the first final round.
Signed-off-by: Geoffrey Lefebvre <geoffrey@cs.ubc.ca>
2009-11-09 19:16:48 +00:00
Keir Fraser ac0982a376 Remus: Buffer checkpoint data locally until domain has resumed execution.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:16:19 +00:00
Keir Fraser 57f44d8638 Remus: Initiate failover if a packet is not received every 500ms.
This breaks checkpoints at lower frequencies, and should be made
optional.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:15:34 +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 b6119955df Remus: Add callbacks for suspend, postcopy and preresume in xc_domain_save.
This makes it possible to perform repeated checkpoints.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:06:25 +00:00
Keir Fraser 4a6d50ad69 x86, hvm: Make host TscInvariant CPUID flag visible to guest by default.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-09 18:54:27 +00:00
Keir Fraser 14ec087884 xentop: Add two more VBD statistics
In addition to VBD read/write request#, add VBD read/write sector#
also. It makes VBD throughput observation easier. As the method to get
such info is OS dependent, just Linux version code is added.

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
2009-11-05 12:00:58 +00:00
Keir Fraser 397ade9be3 xc_resume: fix modify_returncode when host width != guest width
Also improve checking in xc_domain_resume_any().

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-04 22:32:01 +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 0ce73f80ea Linux vbd hotplug: Speed up finding a loopback device
- Use the device and inode information provided by losetup to find
   if the vbd backing file is in use on another vbd.

 - Use losetup to find a free loopback device.

Signed-off-by: Gary Grebus <gary.grebus@oracle.com>
2009-11-03 08:39:21 +00:00