]> xenbits.xensource.com Git - xen.git/log
xen.git
14 years agoxl: Factor out domain death handling into a separate function.
Ian Campbell [Tue, 27 Jul 2010 16:05:12 +0000 (17:05 +0100)]
xl: Factor out domain death handling into a separate function.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxl: Add function to generate random uuid and use it.
Ian Campbell [Tue, 27 Jul 2010 15:59:14 +0000 (16:59 +0100)]
xl: Add function to generate random uuid and use it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl: signal caller if domain already destroyed on domain death event
Ian Campbell [Tue, 27 Jul 2010 15:58:51 +0000 (16:58 +0100)]
libxl: signal caller if domain already destroyed on domain death event

Currently libxl_event_get_domain_death_info returns 0 if the event was
not a domain death event and 1 if it was but does not infom the user
if someone else has already cleaned up the domain, which means the
caller must replicate some of the logic from within libxl.

Instead have the libxl_event_get_XXX_info functions required that the
event is of the right type (the caller must have recently switched on
event->type anyway).

This allows the return codes to be used in an event specific way and
we take advantage of this by returning an error from
libxl_event_get_domain_death_info if the domain is not dying.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: return libxl_dominfo from libxl_event_get_domain_death_info
Ian Campbell [Tue, 27 Jul 2010 15:58:26 +0000 (16:58 +0100)]
libxl: return libxl_dominfo from libxl_event_get_domain_death_info

Removes a libxc data type from the libxl interface.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: add shutdown reason to libxl_dominfo
Ian Campbell [Tue, 27 Jul 2010 15:57:38 +0000 (16:57 +0100)]
libxl: add shutdown reason to libxl_dominfo

Removes the need for explicit libxl_dominfo.crashed so remove it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: Add LIBXL_EVENT namespace prefix to enum libxl_event_type
Ian Campbell [Tue, 27 Jul 2010 15:57:06 +0000 (16:57 +0100)]
libxl: Add LIBXL_EVENT namespace prefix to enum libxl_event_type

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxend (XenAPI): Error in Xend-API method VM_set_actions_after_crash
Lutz Dube [Tue, 27 Jul 2010 15:53:00 +0000 (16:53 +0100)]
xend (XenAPI): Error in Xend-API method VM_set_actions_after_crash

Xend-API defines the method VM_set_actions_after_crash with valid
action names coredump_and_destroy, coredump_and_restart,... . These
values have to be converted into internal representation
"coredump-destroy", "coredump-restart", ...  otherwise start of the
domain is rejected.  Same error occurs, if I try to create a VM using
the Xend-API with actions_after_crash set to coredump_and_destroy.

Could you please apply my patch to xen-4-0-testing, too.

Signed-off-by: Lutz Dube Lutz.Dube@ts.fujitsu.com
Acked-by: Jim Fehlig <jfehlig@novell.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: fix segfault when detaching non-existant disk
Gianni Tedesco [Tue, 27 Jul 2010 15:23:04 +0000 (16:23 +0100)]
libxl: fix segfault when detaching non-existant disk

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years ago# HG changeset patch
Olaf Hering [Mon, 26 Jul 2010 10:29:11 +0000 (11:29 +0100)]
# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1280140115 -3600
# Node ID 8c3e1e8ddd599371d882b17996be88b545119ccb
# Parent  2092c06f9467747da608c448ddd01e2f1f82290a
tools/hotplug: init.d should test for /proc/xen/capabilities being a file

Correct test for /proc/xen/capabilities
It is a file, not a directory.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxenguest: correct order of zlib linker options to avoid link errors
Olaf Hering [Mon, 26 Jul 2010 10:24:51 +0000 (11:24 +0100)]
libxenguest: correct order of zlib linker options to avoid link errors

The order of objects and linked libraries is important with recent
toolchain when --as-needed is used.

Introduce new variable COMPRESSION_LIBS and place it at the end of cc
commandline options.  Without this change, symbols in libbzip2 are not
found when building with openSuSE 11.2 and newer.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools/hotplug etc.: remove Default-Enabled from LSB header
Ian Jackson [Mon, 26 Jul 2010 10:15:40 +0000 (11:15 +0100)]
tools/hotplug etc.: remove Default-Enabled from LSB header

"Default-Enabled:" is not a LSB keyword.
Remove it from the LSB section.

This avoids an openSuSE buildcheck warning and we are not aware of any
reason why it should be kept.

From: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Modified-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools/hotplug: add LSB header to xen-watchdog runlevel script
Olaf Hering [Mon, 26 Jul 2010 10:11:25 +0000 (11:11 +0100)]
tools/hotplug: add LSB header to xen-watchdog runlevel script

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86: Add -fno-exceptions to list of possibly-supported CFLAGS for embedded targets.
Keir Fraser [Sun, 25 Jul 2010 21:20:47 +0000 (22:20 +0100)]
x86: Add -fno-exceptions to list of possibly-supported CFLAGS for embedded targets.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotools/hotplug: Install udev rules into rules.d
Olaf Hering [Fri, 23 Jul 2010 18:23:49 +0000 (19:23 +0100)]
tools/hotplug: Install udev rules into rules.d

Install rules straight into /etc/udev/rules.d
udev version 029 since mid 2004 uses this directory already.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoMerge
Ian Jackson [Fri, 23 Jul 2010 18:14:53 +0000 (19:14 +0100)]
Merge

14 years agotools/libxl: Revert broken NetBSD portability patches
Ian Jackson [Fri, 23 Jul 2010 18:13:29 +0000 (19:13 +0100)]
tools/libxl: Revert broken NetBSD portability patches

Revert
 df9d8319bd37 Fix blktap2 NetBSD build and also revert broken change
 e76befc7fe2d portability fixes from tools/console
 24277e3237ca Fix linking error when creating the xl binary.

Now it builds again.

14 years agoxl: Fix build after info1,info2 change
Ian Jackson [Fri, 23 Jul 2010 17:50:30 +0000 (18:50 +0100)]
xl: Fix build after info1,info2 change

3cdba275e8c0 missed one instance, now fixed.

14 years agoxl: do not try and auto re-connect console on reboot
Ian Campbell [Fri, 23 Jul 2010 17:12:42 +0000 (18:12 +0100)]
xl: do not try and auto re-connect console on reboot

It is not possible to run the console client if we are rebooting a
guest via the backgrounded xl process so we may as well turn off
console autoconnect after the first boot.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxl: use more descriptive names than info1 and info2
Ian Campbell [Fri, 23 Jul 2010 17:11:03 +0000 (18:11 +0100)]
xl: use more descriptive names than info1 and info2

c_info and b_info appears to be the common idiom in other bits of xl.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxl: Spelling fix to ("quite" => "quiet")
Ian Campbell [Fri, 23 Jul 2010 17:09:28 +0000 (18:09 +0100)]
xl: Spelling fix to ("quite" => "quiet")

s/quite/quiet/g

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agocorrect xenballoond.init description in LSB part
Olaf Hering [Fri, 23 Jul 2010 17:01:50 +0000 (18:01 +0100)]
correct xenballoond.init description in LSB part

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools/hotplug: correct xend initscript dependency in LSB part
Olaf Hering [Fri, 23 Jul 2010 16:55:14 +0000 (17:55 +0100)]
tools/hotplug: correct xend initscript dependency in LSB part

Add missing dependencies to runlevel script
xend requires at least xenstored

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools and Makefiles: introduce and use new SYSCONFIG_DIR variable
Olaf Hering [Fri, 23 Jul 2010 16:50:05 +0000 (17:50 +0100)]
tools and Makefiles: introduce and use new SYSCONFIG_DIR variable

On SuSE the configuration files in /etc/sysconfig/ will be updated in
a smart way from templates found in /var/adm/fillup-templates/
Introduce new variable SYSCONFIG_DIR for Linux installations.  Now
only one place needs patching, or it can be specified as option to
make(1).

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl/xl: correctly report domain state.
Ian Campbell [Fri, 23 Jul 2010 16:39:32 +0000 (17:39 +0100)]
libxl/xl: correctly report domain state.

In particular distinguish between domain shutdown and crash and the
blocked and running states.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: do not create /vss and /xapi paths in xenstore.
Ian Campbell [Fri, 23 Jul 2010 16:35:59 +0000 (17:35 +0100)]
libxl: do not create /vss and /xapi paths in xenstore.

libxl doesn't know anything about these paths and there is no reason
it needs to manage them.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools/xend: Fix performance of xend with more than 10000 FC device paths
"Dube, Lutz" [Fri, 23 Jul 2010 16:34:35 +0000 (17:34 +0100)]
tools/xend: Fix performance of xend with more than 10000 FC device paths

On server startup xend start or a later xend restart needs approx. 30 min to
start/restart. Without attached FC devices xend start/restart needs only some
seconds.

server type: Fujitsu Primergy RX600-S5

The time gets lost in xen/xend/XendNode.py line 329 while calling
vscsi_util.get_all_scsi_device().

329         for pscsi_record in vscsi_util.get_all_scsi_devices():
330             scsi_id = pscsi_record['scsi_id']
331             if scsi_id:
332                 saved_HBA_uuid = None

I think, in most cases we don't need all the PSCSI devices registered in
xend, but only a few of it.
So a good solution for this perforamce issue is to scan only the SCSI device
paths we need, controlled by a new option in xend-config.sxp.

I have made a patch to allow specification of scsi devices we need in xend
in the config file xend-config.sxp.
The new options pscsi-device-mask expects a list of device ids oder partial
device ids like the option of lsscsi, e.g.
(pscsi-device-mask ('<partial-dev-id1' 'partial-dev-id2' ...))

Without this option set in xend-config.sxp or if lsscsi is not support, all
device paths are process like today.

Signed-off-by: Lutz Dube Lutz.Dube@ts.fujitsu.com
Comment from Masaki Kanno <kanno.masaki@jp.fujitsu.com>: "Well done"
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: consistent handling of libxc errors
Gianni Tedesco [Fri, 23 Jul 2010 16:26:28 +0000 (17:26 +0100)]
libxl: consistent handling of libxc errors

Lots of places in libxl return -1 as an error which is inconsistent with
libxl error codes since that is ERROR_VERSION.  Also in other places the
xc_* function to implement a command is called but the return value is
either never checked or not passed on.

This patch makes callers of libxc functions use XL_LOG_ERRNO to log a
suitable message including the contents of errno, before returning
ERROR_FAIL, if an xc call fails.  (Except for pci device removals and
domain destroys where release of resources ought to continue even if
an error occurs in an early step. In this case the error is still
logged at least.)

Also a bug is fixed where a caller depends on errno being set but is
cleared by cleanup code which calls in to library functions which modify
errno as a side-effect.

This is version 2 of the patch previously applied as 91c486918e02.
Changed since then: Removed mapping from libxc error codes to libxl -
this is redundant because libxl ought to return -1 with errno set to a
meaningful value.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: remove xenstore /local/domain/<domid> after reading /vm and /vss paths
Ian Campbell [Fri, 23 Jul 2010 16:06:16 +0000 (17:06 +0100)]
libxl: remove xenstore /local/domain/<domid> after reading /vm and /vss paths

On domain destroy libxl currently tries to find the /vm/<uuid> and
/vss/<uuid> paths by reading /local/domain/<domid>/{vm,vss} but does
so after removing /local/domain/<domid> which isn't much use.

Also construct the xenstore path in destroy the same way as in create. It's not
wrong but I had to look twice to check they were doing the same thing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools/libxl: usbdevice should imply usb
Stefano Stabellini [Fri, 23 Jul 2010 15:58:35 +0000 (16:58 +0100)]
tools/libxl: usbdevice should imply usb

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools/libxl: Fix blktap2 NetBSD build and also revert broken change
Christoph Egger [Fri, 23 Jul 2010 15:46:59 +0000 (16:46 +0100)]
tools/libxl: Fix blktap2 NetBSD build and also revert broken change

Fix e76befc7fe2d which broke the build.
Also revert 24277e3237ca which was broken.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxc: Do not bother initialising shared-info page in HVM-domain builder.
Keir Fraser [Thu, 22 Jul 2010 14:24:49 +0000 (15:24 +0100)]
libxc: Do not bother initialising shared-info page in HVM-domain builder.

It is already zeroed by the hypervisor, and setting the evtchn_mask
array is pointless since its location varies between 32- and 64-bit
guests, and the builder can't know which is the correct bitness.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agohvmloader: clear the whole shared-info page when shutting down xenbus
Keir Fraser [Thu, 22 Jul 2010 14:19:25 +0000 (15:19 +0100)]
hvmloader: clear the whole shared-info page when shutting down xenbus
since the contents might be in the wrong word-size for later users.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoRevert 91c486918e02 "More consistent error handling in libxl"
Ian Jackson [Wed, 21 Jul 2010 15:50:15 +0000 (16:50 +0100)]
Revert 91c486918e02 "More consistent error handling in libxl"

I'm afraid this pattern is wrong for two reasons.  Firstly,
xc_domain_pause and functions like it do not return XC_ERROR_* values.
They typically return -1 on error, and set errno.

Secondly, the error codes from libxc are not really all that useful.
They mostly serve to identify where the error originated.

See the comment in xenctrl.h near line 70.

14 years agostubdom: correct handling DESTDIR during build
Ian Campbell [Wed, 21 Jul 2010 15:36:19 +0000 (16:36 +0100)]
stubdom: correct handling DESTDIR during build

The stubdom/Makefile expects components to install themselves to
stubdom/$(CROSS_ROOT) and passes the appropriate configure and make
variables to make this happen.

However if the top-level build uses DESTDIR then this not only effects
the installation targets in stubdom/Makefile but is also propagated to
the individual components' build causing them to install into an
unexpected location and breaking the build.

In other words "make -C stubdom DESTDIR=/tmp/a-dest-dir" fails due to missing
headers because they had been installed into /tmp/a-dest-dir instead of
stubdom/$(CROSS_ROOT).

The existing attempt to clear DESTDIR for the newlib install phase was
insufficient.

Define a CROSS_MAKE variable which should be used to recurse into the
cross compiled components and which clears DESTDIR.

Also move the definition of the genpath target to after the first
"all" target so that the default target is all.

I have confirmed that with this fix only the Xen build system outputs end up in
/tmp/a-dest-dir.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agobuild: Make all GIT download URLs depend correctly on GIT_HTTP={y,n}
Keir Fraser [Wed, 21 Jul 2010 08:02:10 +0000 (09:02 +0100)]
build: Make all GIT download URLs depend correctly on GIT_HTTP={y,n}

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86: New boot option availmem= to limit usable system RAM.
Keir Fraser [Wed, 21 Jul 2010 07:43:35 +0000 (08:43 +0100)]
x86: New boot option availmem= to limit usable system RAM.

Unlike mem=, this specifies the limit on usable RAM, rather than a
limit on maximum physical address of RAM.

Original patch by Sarina Canelake <sarina.canelake@Oracle.Com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoMerge
Keir Fraser [Tue, 20 Jul 2010 16:56:07 +0000 (17:56 +0100)]
Merge

14 years agoAttached patch fixes linking error when creating the xl binary.
Stefano Stabellini [Tue, 20 Jul 2010 16:37:09 +0000 (17:37 +0100)]
Attached patch fixes linking error when creating the xl binary.
The xl binary compiles in xl_cmdimpl.c which calls code from
libxl_paths.c and libxl_bootloader.c.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoAttached patch takes over some portability fixes from tools/console
Stefano Stabellini [Tue, 20 Jul 2010 16:26:38 +0000 (17:26 +0100)]
Attached patch takes over some portability fixes from tools/console
to make libxl build on NetBSD.

blktapctl is build on Linux only. This will be another patch to finally
unbreak libxl.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoimplement xl vncviewer
Stefano Stabellini [Tue, 20 Jul 2010 16:22:14 +0000 (17:22 +0100)]
implement xl vncviewer

Implement xl vncviewer. The only difference from xm vncviewer is that we
obey the VNCVIEWER environment variable.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agohvmloader/gpxe: Add a couple of bug-fix patches from upstream gpxe
Keir Fraser [Tue, 20 Jul 2010 15:09:50 +0000 (16:09 +0100)]
hvmloader/gpxe: Add a couple of bug-fix patches from upstream gpxe

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agohvmloader: clear the xenbus event-channel when we're done with it.
Keir Fraser [Tue, 20 Jul 2010 12:42:17 +0000 (13:42 +0100)]
hvmloader: clear the xenbus event-channel when we're done with it.
Otherwise a later xenbus client that naively waits for the rising edge
could get stuck.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agogdbsx: Implement missing Makefile rules.
Keir Fraser [Tue, 20 Jul 2010 10:26:20 +0000 (11:26 +0100)]
gdbsx: Implement missing Makefile rules.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agotools: Update distclean target to remove auto-gen'ed tarballs.
Keir Fraser [Tue, 20 Jul 2010 10:18:39 +0000 (11:18 +0100)]
tools: Update distclean target to remove auto-gen'ed tarballs.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agohvmloader: Download gpxe bits via HTTP rather than GIT protocol.
Keir Fraser [Tue, 20 Jul 2010 10:09:21 +0000 (11:09 +0100)]
hvmloader: Download gpxe bits via HTTP rather than GIT protocol.

Latter is faster but won't work through all firewall setups.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agohvmloader: Build GPXE from upstream git repo, latest release tag.
Keir Fraser [Tue, 20 Jul 2010 09:58:04 +0000 (10:58 +0100)]
hvmloader: Build GPXE from upstream git repo, latest release tag.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoMerge
Keir Fraser [Mon, 19 Jul 2010 17:56:02 +0000 (18:56 +0100)]
Merge

14 years agoMore consistent error handling in libxl
Stefano Stabellini [Mon, 19 Jul 2010 17:40:09 +0000 (18:40 +0100)]
More consistent error handling in libxl

Lots of places in libxl return -1 as an error which is inconsistent with
libxl error codes since that is ERROR_VERSION. Also in other places the
xc_* function to implement a command is called but the return value is
either never checked or not passed on.

This patch introduces a new internal function libxl_xc_error() which
maps xc error codes to xl error codes. Callers of libxc functions are
converted to use this when returning error codes back to libxl callers.

Also a bug is fixed where a caller depends on errno being set but is
cleared by cleanup code which calls in to library functions which modify
errno as a side-effect.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
14 years agoImplement xl dump-core
Stefano Stabellini [Mon, 19 Jul 2010 14:33:38 +0000 (15:33 +0100)]
Implement xl dump-core

Implements dump-core command which is similar to xm dump-core except
that it requires an additional argument which is the target filename.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
14 years agomake libxl build since 21811
Stefano Stabellini [Mon, 19 Jul 2010 14:15:32 +0000 (15:15 +0100)]
make libxl build since 21811

First hunk, I assume is getting the arguments in wrong order on memset.

Second hunk is to kill a compiler warning about mis-use of printf-style
format strings which kills the build on -Werror.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
14 years agoActually it's an interrupt descriptor table register :)
Stefano Stabellini [Mon, 19 Jul 2010 14:11:07 +0000 (15:11 +0100)]
Actually it's an interrupt descriptor table register :)

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
14 years agotools: gpxe build fix for NetBSD
Keir Fraser [Mon, 19 Jul 2010 14:10:20 +0000 (15:10 +0100)]
tools: gpxe build fix for NetBSD

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoThis patch introduces libxl_primary_console_exec: a new libxl function
Stefano Stabellini [Mon, 19 Jul 2010 11:47:53 +0000 (12:47 +0100)]
This patch introduces libxl_primary_console_exec: a new libxl function
that finds the domid and console number corresponding to the primary
console of a given vm. The domid might be different from the domid of
the VM and the console number might not be 0 when using stubdoms.
The caller (xl_cmdimpl.c in this case) has to make sure that the stubdom
is already created before calling libxl_primary_console_exec in the hvm
case. In the PV case libxl_primary_console_exec has to be called before
libxl_run_bootloader.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agoexecute command by execvp() so can search command in PATH.
Stefano Stabellini [Mon, 19 Jul 2010 11:22:25 +0000 (12:22 +0100)]
execute command by execvp() so can search command in PATH.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
14 years agoImprove balloon support for NetBSD.
Stefano Stabellini [Mon, 19 Jul 2010 11:22:04 +0000 (12:22 +0100)]
Improve balloon support for NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
14 years agoWithout this we leak an fd on each domain shutdown and eventually run
Stefano Stabellini [Mon, 19 Jul 2010 11:21:24 +0000 (12:21 +0100)]
Without this we leak an fd on each domain shutdown and eventually run
out of file descriptors meaning new the console of new domains are not
logged.

Seems to have been accidentally removed in 16638:28921e83000b.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agoImplement "xl tmem-freeable" to match "xm tmem-freeable".
Stefano Stabellini [Mon, 19 Jul 2010 11:20:41 +0000 (12:20 +0100)]
Implement "xl tmem-freeable" to match "xm tmem-freeable".

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
14 years agoMerge
Keir Fraser [Fri, 16 Jul 2010 16:44:04 +0000 (17:44 +0100)]
Merge

14 years agovtd: Do not update-and-flush an IOMMU PTE if it does not change.
Keir Fraser [Fri, 16 Jul 2010 16:41:53 +0000 (17:41 +0100)]
vtd: Do not update-and-flush an IOMMU PTE if it does not change.

There are cases of identical repeated calls to
iommu_map_page(). Flushing is slow, so it's worth detecting these and
bailing early.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoiommu: Map dom0 initial allocation in 'dom0-strict' iommu mode.
Keir Fraser [Fri, 16 Jul 2010 15:19:51 +0000 (16:19 +0100)]
iommu: Map dom0 initial allocation in 'dom0-strict' iommu mode.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86: use cpuid vector 0xb when available for detecting cpu topology
Keir Fraser [Fri, 16 Jul 2010 12:54:44 +0000 (13:54 +0100)]
x86: use cpuid vector 0xb when available for detecting cpu topology

cpuid leaf 0xb provides extended topology enumeration. This interface
provides the 32-bit x2APIC id of the logical processor and it also
provides a new mechanism to detect SMT and core siblings (which
provides increased addressability).

Signed-off-by: Weidong Han <weidong.han@intel.com>
14 years agoACPI: add support for x2APIC ACPI extensions
Keir Fraser [Fri, 16 Jul 2010 12:52:18 +0000 (13:52 +0100)]
ACPI: add support for x2APIC ACPI extensions

All logical processors with APIC ID values of 255 and greater will
have their APIC reported through Processor X2APIC structure (type-9
entry type) and all logical processors with APIC ID less than 255 will
have their APIC reported through legacy Processor Local APIC (type-0
entry type) only. This is the same case even for NMI structure
reporting.

The Processor X2APIC Affinity structure provides the association
between the X2APIC ID of a logical processor and the proximity domain
to which the logical processor belongs.

This patch adds 2 new subtables to MADT and one new subtable to SRAT.

This patch also changes x86_acpiid_to_apicid from u8 to u32 for x2APIC
ID, and changes mp_register_lapic to accept 32-bit id. But there are
still some 8-bit apic id hardcode and assumptions in Xen code, it
needs to be fixed in future.

Signed-off-by: Weidong Han <weidong.han@intel.com>
14 years agoxen: Send the debug VIRQ to guests after the rest of the domain dump is done.
Keir Fraser [Fri, 16 Jul 2010 12:51:27 +0000 (13:51 +0100)]
xen: Send the debug VIRQ to guests after the rest of the domain dump is done.

Send the debug VIRQ to guests after the rest of the domain dump is
done. This stops all the 'q' debug-key output getting interleaved with
the debug-virq output from a pv-ops dom0 kernel.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
14 years agoBefore this patch only log messages with precisely priority
Stefano Stabellini [Fri, 16 Jul 2010 11:10:56 +0000 (12:10 +0100)]
Before this patch only log messages with precisely priority
LOG_WARNING (or precisely LOG_DEBUG if -v) would be logged.

xenconsoled only actually logs using LOG_ERR and LOG_DEBUG so for the
most part we would have been logging absolutely nothing up until now.

Linux provides a LOG_UPTO macro but I'm not sure how portable that is
so I have opencoded the list of levels.

Do I get some sort of prize for fixing a bug introduced in 2005?

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agopygrub: look in every partition for something to boot
Ian Jackson [Thu, 15 Jul 2010 17:18:16 +0000 (18:18 +0100)]
pygrub: look in every partition for something to boot

pygrub: look in every partition for something to boot, in case
the OS installer (SLES 10 sp1 in particular) forgets to mark the
boot partition as active.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: David Markey <admin@dmarkey.com>
14 years agoxm: Do not check path of kernel if bootloader is specified
Ian Jackson [Thu, 15 Jul 2010 15:32:50 +0000 (16:32 +0100)]
xm: Do not check path of kernel if bootloader is specified

When create DomU, if bootloader is specified, 'kernel/ramdisk' will be
used by bootloader when boots DomU. So it is needless to check the
path is existent or not.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
14 years agogdbsx: update README and remove space in q packet
Ian Jackson [Thu, 15 Jul 2010 15:30:24 +0000 (16:30 +0100)]
gdbsx: update README and remove space in q packet

Newer version of gdb, version 7*, seems to have bug where it is not
parsing thread list from gdbsx properly. Getting rid of the space in
thread list works around it. It's ok with older gdb also.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
14 years agoxl: start numbering vifs from 0
Ian Jackson [Wed, 14 Jul 2010 15:46:49 +0000 (16:46 +0100)]
xl: start numbering vifs from 0

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agolibxl, xl: support running bootloader (e.g. pygrub) in domain 0
Ian Jackson [Wed, 14 Jul 2010 15:45:38 +0000 (16:45 +0100)]
libxl, xl: support running bootloader (e.g. pygrub) in domain 0

Much of the bootloader interaction (including the Solaris and NetBSD
portability bits) are translated pretty much directly from the python
in tools/python/xen/xend/XendBootloader.py

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl: add function to attach/detach a disk to/from the local VM
Ian Jackson [Wed, 14 Jul 2010 15:44:18 +0000 (16:44 +0100)]
libxl: add function to attach/detach a disk to/from the local VM

Useful if you need to read a guest filesystem (e.g. pygrub).

I'm not overly thrilled with the implementation WRT tap interfaces,
particularly WRT to detach. I was unable to find a way to get at the
paramters necessary to call tap_ctl_destroy so I assumed for now it
that is OK to assume that the tap device is going to be wanted for the
actual domain at some point in the immediate future and hence there is
no pressing need to destroy it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl: support mapping files rather than carrying paths around
Ian Jackson [Wed, 14 Jul 2010 15:43:49 +0000 (16:43 +0100)]
libxl: support mapping files rather than carrying paths around

This will allow us to map and then unlink the file and therefore
delete the process on process exit or explicit unmap.

Using the mmaped versions of these files required rewriting build_pv
to use the xc_dom builder functionality directly rather than through
the xc_linux_build "compatibility layer". (The status of the
xc_linux_build interface as a compatibility layer seems a bit dubious
since all existing callers use it but if anything is going to replace
it then libxl seems like the likely candidate).

I'm not thrilled with the definition of the maps lifecycle. This could
be solved by adding a helper function to explicitly free the toplevel
structure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl, xl: exec xenconsole in current process, defer decision to fork to caller
Ian Jackson [Wed, 14 Jul 2010 15:40:33 +0000 (16:40 +0100)]
libxl, xl: exec xenconsole in current process, defer decision to fork to caller

Use this to run xenconsole as the foreground process and move the
connection to the console in the "create -c" case early enough to be
able to view output from the bootloader. This behaviour is consistent
with how both "xm console" and "xm create -c" operate.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl: fix typo in comment
Ian Jackson [Wed, 14 Jul 2010 15:40:09 +0000 (16:40 +0100)]
libxl: fix typo in comment

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl: add libxl_strdup convenience function
Ian Jackson [Wed, 14 Jul 2010 15:39:43 +0000 (16:39 +0100)]
libxl: add libxl_strdup convenience function

Use in preference to libxl_sprintf(..., "%s", "...")

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agolibxl: add printf attribute to libxl_xs_write and fixup resulting warnings
Ian Jackson [Wed, 14 Jul 2010 15:38:47 +0000 (16:38 +0100)]
libxl: add printf attribute to libxl_xs_write and fixup resulting warnings

There is an unfortunate warning for the empty format string by default
which I workaround by adding -Wno-format-zero-length.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agoxenconsole: do not exit if a pty device is missing
Ian Jackson [Wed, 14 Jul 2010 15:36:47 +0000 (16:36 +0100)]
xenconsole: do not exit if a pty device is missing

This can just mean we have raced with the bootloader exiting and if we
continue we will likely see the real domain console show up.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agopygrub: introduce easier to parse output format
Ian Jackson [Wed, 14 Jul 2010 15:36:23 +0000 (16:36 +0100)]
pygrub: introduce easier to parse output format

libxl would rather like to parse the output of pygrub. Rather than
implement an SXP parser in libxl add a --output-format option to
pygrub which can select an alternative, simpler to parse,
format. Available formats are:
    sxp: current SXP output format;
    simple: simple key+value output with \n separating item ( for
debugging). key and value are separated by a single
space (and key therefore cannot contain a space);
    simple0: as simple but with \0 as a separator;

Also add --output-directory to allow temporary files to be placed
somewhere other than /var/run/xend/boot.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agotools/ocaml: add the missing license file that all OCaml libs refer to
Ian Jackson [Wed, 14 Jul 2010 15:32:47 +0000 (16:32 +0100)]
tools/ocaml: add the missing license file that all OCaml libs refer to

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
14 years agoxl: default timer_mode to 1
Ian Jackson [Wed, 14 Jul 2010 15:31:59 +0000 (16:31 +0100)]
xl: default timer_mode to 1

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
14 years agotools/misc/xenpm: provide core/package cstate residencies
Ian Jackson [Wed, 14 Jul 2010 15:30:42 +0000 (16:30 +0100)]
tools/misc/xenpm: provide core/package cstate residencies

According to Intel 64 and IA32 Architectures SDM 3B Appendix B, Intel
Nehalem/Westmere processors provide h/w MSR to report the core/package
cstate residencies.Extend sysctl_get_pmstat interface to pass the
core/package cstate residencies, and modify xenpm to output those
information.

[tools part of the patch]

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agotools/misc/xenpm: fix get-cpu-topology
Ian Jackson [Tue, 13 Jul 2010 18:34:48 +0000 (19:34 +0100)]
tools/misc/xenpm: fix get-cpu-topology

fix get-cpu-topology

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agotools/ocaml: Properly adjust fields in ocaml structure to match the C layer.
Ian Jackson [Tue, 13 Jul 2010 18:28:13 +0000 (19:28 +0100)]
tools/ocaml: Properly adjust fields in ocaml structure to match the C layer.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
14 years agotools/ocaml: add a simple logger to the ocaml bindings
Ian Jackson [Tue, 13 Jul 2010 18:27:50 +0000 (19:27 +0100)]
tools/ocaml: add a simple logger to the ocaml bindings

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
14 years agotools/ocaml: register the ocaml exception so it can be used at the C level.
Ian Jackson [Tue, 13 Jul 2010 18:27:33 +0000 (19:27 +0100)]
tools/ocaml: register the ocaml exception so it can be used at the C level.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
14 years agotools/debugger/gdbsx: enabled by only x86
Ian Jackson [Tue, 13 Jul 2010 18:08:48 +0000 (19:08 +0100)]
tools/debugger/gdbsx: enabled by only x86

The changeset 21752:29e545151078 breaks ia64, since gdbsx supports
only x86.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agox86: optimize this_cpu()
Keir Fraser [Tue, 13 Jul 2010 17:17:28 +0000 (18:17 +0100)]
x86: optimize this_cpu()

Besides the .text space savings of over 2.5k on x86-64 (1.5k for
x86-32) this removes a load (plus a lea on x86-64) from various
frequently executed code paths, and finally provides a reason (other
than legibility) to prefer this_cpu() over per_cpu() in all places
where smp_processor_id() isn't being called anyway.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years ago[IOMMU] Debug info for AMD IOMMU event log
Keir Fraser [Tue, 13 Jul 2010 17:13:33 +0000 (18:13 +0100)]
[IOMMU] Debug info for AMD IOMMU event log

Print out the event log entry content for debug purposes.
Additionally, when IOMMU reset event log (due to event log overflow),
we should print out the event log content for debugging.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Wei Wang <wei.wang2@amd.com>
14 years agox86: Avoid assumptions about C struct layouts from asm code.
Keir Fraser [Tue, 13 Jul 2010 17:12:15 +0000 (18:12 +0100)]
x86: Avoid assumptions about C struct layouts from asm code.

Largely this involves avoiding assumptions about 'struct cpu_info'.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agosysctl: Another clarification re. max_cpu_index.
Keir Fraser [Mon, 12 Jul 2010 17:39:18 +0000 (18:39 +0100)]
sysctl: Another clarification re. max_cpu_index.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agosysctl: Make meaning of max_cpu_index field clearer.
Keir Fraser [Mon, 12 Jul 2010 17:33:30 +0000 (18:33 +0100)]
sysctl: Make meaning of max_cpu_index field clearer.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86, pm: provide core/package cstate residencies
Keir Fraser [Mon, 12 Jul 2010 17:30:26 +0000 (18:30 +0100)]
x86, pm: provide core/package cstate residencies

According to Intel 64 and IA32 Architectures SDM 3B Appendix B, Intel
Nehalem/Westmere processors provide h/w MSR to report the core/package
cstate residencies. Extend sysctl_get_pmstat interface to pass the
core/package cstate residencies.

Signed-off-by: Wei Gang <gang.wei@intel.com>
14 years agoConsolidate MSI-X related definitions
Keir Fraser [Mon, 12 Jul 2010 09:48:34 +0000 (10:48 +0100)]
Consolidate MSI-X related definitions

Eliminate redundant ones, fix names (where so far inappropriately
referring to capability structure fields the don't really relate to),
use symbolic names instead of raw numbers, and remove an unusable one.

No functional change intended.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86 cpufreq: Fix debug=y build.
Keir Fraser [Mon, 12 Jul 2010 09:48:04 +0000 (10:48 +0100)]
x86 cpufreq: Fix debug=y build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agox86: allow the MSI-X table to reside beyond 4G even on 32-bit systems
Keir Fraser [Mon, 12 Jul 2010 09:43:57 +0000 (10:43 +0100)]
x86: allow the MSI-X table to reside beyond 4G even on 32-bit systems

Underlying interfaces allow this, and unduly (and silently) truncating
addresses doesn't seem nice.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: prevent simultaneous use of MSI and MSI-X
Keir Fraser [Mon, 12 Jul 2010 09:43:34 +0000 (10:43 +0100)]
x86: prevent simultaneous use of MSI and MSI-X

This matches similar checks done in Linux, since no good can come from
a domain trying to enable both MSI and MSI-X on the same device at the
same time.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86: fix a benign typo
Keir Fraser [Mon, 12 Jul 2010 09:43:10 +0000 (10:43 +0100)]
x86: fix a benign typo

Just to avoid confusing readers - no functional change.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agox86/cpufreq: pass pointers to cpu masks where possible
Keir Fraser [Mon, 12 Jul 2010 09:41:48 +0000 (10:41 +0100)]
x86/cpufreq: pass pointers to cpu masks where possible

This includes replacing the bogus definition of cpumask_test_cpu()
(introduced by c/s 20073) with a Linux compatible one and replacing
the bad uses with cpu_isset().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoupdate QEMU_TAG to 833e7e9a4c95739429dc0c803bbbf2346f9897fd
Ian Jackson [Fri, 9 Jul 2010 17:49:12 +0000 (18:49 +0100)]
update QEMU_TAG to 833e7e9a4c95739429dc0c803bbbf2346f9897fd

14 years agotools/hotplug: xencommons: xenconsoled tracing
Ian Jackson [Fri, 9 Jul 2010 17:46:07 +0000 (18:46 +0100)]
tools/hotplug: xencommons: xenconsoled tracing

cut and paste error lead to using the xenstored command line syntax
for xenconsoled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agox86 hvm: Add a hypercall to allow HVM PV drivers to insert xentrace records
Keir Fraser [Fri, 9 Jul 2010 16:16:41 +0000 (17:16 +0100)]
x86 hvm: Add a hypercall to allow HVM PV drivers to insert xentrace records

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>