Gianni Tedesco [Wed, 4 Aug 2010 13:23:29 +0000 (14:23 +0100)]
xl: PCI code cleanups
Get rid of scan_sys_pcidir() and open-code it inside
libxl_device_pci_list_assignable() since it's not a generically re-useable
function and we're not supporting pcistub driver now. Also use macros for sysfs
dirs in libxl_device_pci_reset
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Campbell [Tue, 3 Aug 2010 17:10:28 +0000 (18:10 +0100)]
xl: fix memory leaks in xl create
Found using "valgrind xl create -n ..." and "valgrind xl create -e ..."
freeing config_data solves:
==18276== 944 bytes in 1 blocks are definitely lost in loss record 12 of 12
==18276== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==18276== by 0x404AEC1: libxl_read_file_contents (libxl_utils.c:258)
==18276== by 0x8056865: create_domain (xl_cmdimpl.c:1314)
==18276== by 0x8057E2D: main_create (xl_cmdimpl.c:3135)
==18276== by 0x804B2FB: main (xl.c:76)
==18276==
Adding free_domain_config() solves the following (plus presumably others
which didn't trigger because I have no devices of that type).
d_config->disks:
==18276== 61 (32 direct, 29 indirect) bytes in 1 blocks are definitely lost in loss record 9 of 12
==18276== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==18276== by 0x4022F94: realloc (vg_replace_malloc.c:525)
==18276== by 0x804E2D3: parse_config_data (xl_cmdimpl.c:715)
==18276== by 0x8056A7C: create_domain (xl_cmdimpl.c:1347)
==18276== by 0x8057E2D: main_create (xl_cmdimpl.c:3135)
==18276== by 0x804B2FB: main (xl.c:76)
d_config->vifs:
==18276== 76 (48 direct, 28 indirect) bytes in 1 blocks are definitely lost in loss record 10 of 12
==18276== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==18276== by 0x4022F94: realloc (vg_replace_malloc.c:525)
==18276== by 0x804E665: parse_config_data (xl_cmdimpl.c:779)
==18276== by 0x8056A7C: create_domain (xl_cmdimpl.c:1347)
==18276== by 0x8057E2D: main_create (xl_cmdimpl.c:3135)
==18276== by 0x804B2FB: main (xl.c:76)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Campbell [Tue, 3 Aug 2010 17:09:21 +0000 (18:09 +0100)]
libxl: fix memory leak in libxl_name_to_domid
Found with "valgrind xl destroy ...":
==16272== 53,248 bytes in 1 blocks are definitely lost in loss record 6 of 6
==16272== at 0x4022249: calloc (vg_replace_malloc.c:467)
==16272== by 0x403FD4A: libxl_list_domain (libxl.c:490)
==16272== by 0x404B901: libxl_name_to_domid (libxl_utils.c:65)
==16272== by 0x804B4D2: domain_qualifier_to_domid (xl_cmdimpl.c:181)
==16272== by 0x804B50F: find_domain (xl_cmdimpl.c:198)
==16272== by 0x804D70C: destroy_domain (xl_cmdimpl.c:2104)
==16272== by 0x8054E4C: main_destroy (xl_cmdimpl.c:2912)
==16272== by 0x804B2FB: main (xl.c:76)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Christoph Egger [Tue, 3 Aug 2010 16:41:03 +0000 (17:41 +0100)]
libxl: typo in error message
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Gianni Tedesco [Tue, 3 Aug 2010 16:34:08 +0000 (17:34 +0100)]
libblktapctl: fix use-after-free bug
This has not caused crashes because generally use after free is OK
provided nothing else is going on. However the patch makes things
correct. It also allows us to use heap poisoning feature of valgrind on
tools linking to libblktapctl.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Mihir Nanavati [Tue, 3 Aug 2010 16:14:06 +0000 (17:14 +0100)]
Allow PCI passthrough to PV guest without IOMMU
Added a check which allows adding and removal of PCI devices for PV
guests in the absence of an IOMMU.
Signed-off-by: Mihir Nanavati <mihirn@cs.ubc.ca>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Campbell [Fri, 30 Jul 2010 15:20:48 +0000 (16:20 +0100)]
libxc: free thread specific hypercall buffer on xc_interface_close
The per-thread hypercall buffer is usually cleaned up on pthread_exit
by the destructor passed to pthread_key_create. However if the calling
application is not threaded then the destructor is never called.
This frees the data for the current thread only but that is OK since
any other threads will be cleaned up by the destructor.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Zhigang Wang [Fri, 30 Jul 2010 14:22:39 +0000 (15:22 +0100)]
xl: remove duplicate -d option from create help message
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Fri, 30 Jul 2010 14:16:18 +0000 (15:16 +0100)]
xl: destroy the logger before exit
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Fri, 30 Jul 2010 14:15:54 +0000 (15:15 +0100)]
xl: free the libxl context before exit
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Fri, 30 Jul 2010 14:15:24 +0000 (15:15 +0100)]
xl: return(N) from individual commands to top level instead of exit(N)
This allows the top level command dispatcher to cleanup some of its
own allocations.
This is a fairly mechanical conversion of exit(FOO) into return FOO
for the top-level command functions (i.e. main_*). There are still
code paths which will exit() further down the call chains which will
require actual thought.
At first glance not all the return codes are which one would normally
expect for process exit codes (e.g. some are negative) but I didn't
attempt to address that here.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Fri, 30 Jul 2010 14:12:56 +0000 (15:12 +0100)]
xl: support "xl list <domain>"
xm list takes an optional domain argument; make xl list do likewise.
This also gets rid of a small amount of code which was duplicated
between list_domains and list_domains_details.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Fri, 30 Jul 2010 14:12:10 +0000 (15:12 +0100)]
libxl: const-correctness for libxl_uuid2string
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Zhigang Wang [Fri, 30 Jul 2010 13:28:39 +0000 (14:28 +0100)]
libxl: fix fstat implicit declaration build error
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Fri, 30 Jul 2010 10:36:34 +0000 (11:36 +0100)]
x86: unmask CPUID levels on Intel CPUs
If the CPUID limit bit in MSR_IA32_MISC_ENABLE is set, clear it to
make all CPUID information available. This is required for some
features to work, such as MWAIT in cpuidle, get cpu topology, XSAVE,
etc.
Signed-off-by: Wei Gang <gang.wei@intel.com>
Paul Durrant [Thu, 29 Jul 2010 17:58:19 +0000 (18:58 +0100)]
tools/misc: xen-hvmcrash: New tool to attempt to crash HVM guests
This tool reads the CPU save records, overwrites RIP with a bogus
value, and then restores them. This is, of course, not guaranteed
to crash the guest (since the CPUs may not be executing in kernel
at the time) but it's good for breaking into some tight loops that
would be hard to debug otherwise.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Gianni Tedesco [Thu, 29 Jul 2010 17:52:33 +0000 (18:52 +0100)]
libxl: Check whether a PCI device is assignable before assigning it do a domU
Implement a new libxl function libxl_device_pci_list_assignable. This is
used to implement the xl list-assignable-pci-devices command and part of
the implementation is used to make sure that PCI devices are not multiply
assigned to one or more domU's before doing the passthrough assignment.
The function libxl_device_pci_list changes to libxl_device_pci_list_assigned
due to a parameter change for consistency with pci_list_assignable.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Gianni Tedesco [Thu, 29 Jul 2010 17:49:47 +0000 (18:49 +0100)]
libxl: Move libxl_device_pci_reset to libxl_pci.c
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Patrick Colp [Thu, 29 Jul 2010 15:53:40 +0000 (16:53 +0100)]
tools/xenpaging: Fix some memory leaks on error paths.
This isn't directly related to EPT checking, but does some general fix-ups
to the xenpaging code (adds some extra frees, etc.)
Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Kuwamura Shin'ya [Thu, 29 Jul 2010 15:40:47 +0000 (16:40 +0100)]
xend: fix SyntaxError for Python 2.4 or earlier
21866:
e017930af272 causes SyntaxError on Python 2.4 or earlier, since
the syntax "true_value if condition else false_value" was introduced
by Python 2.5.
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Christoph Egger [Thu, 29 Jul 2010 15:12:50 +0000 (16:12 +0100)]
libxl: Portability fixes for pty handling, in libxl_osdeps.h
This is the same approach used in tools/console, although we have a
separate instance of it as it is difficult to share code between these
two places.
Also add a missing include of <termios.h>, and fix a literal use of
-lutil to refer to UTIL_LIBS.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 29 Jul 2010 14:56:13 +0000 (15:56 +0100)]
Subject: xl: log unknown domain shutdown reason and default to destroy
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Thu, 29 Jul 2010 09:31:21 +0000 (10:31 +0100)]
kexec: Clean up shutdown logic. Reinstate ACPI DMAR during kexec.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Ian Jackson [Wed, 28 Jul 2010 15:32:33 +0000 (16:32 +0100)]
Merge
Ian Campbell [Wed, 28 Jul 2010 15:18:44 +0000 (16:18 +0100)]
libxl: consistently use typedef struct {} libxl_$type
typedef struct seems to be the dominant idiom in the mixture currently
in use.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Wed, 28 Jul 2010 07:32:01 +0000 (08:32 +0100)]
x86: Correctly cook command lines for GRUB2.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 28 Jul 2010 06:54:40 +0000 (07:54 +0100)]
xenpaging: Add a check to Xen for EPT.
There isn't seem to be a way to directly check for EPT, so instead
check for HAP and an Intel processor. If EPT isn't enabled, then
return an error to the tool.
Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
Keir Fraser [Wed, 28 Jul 2010 06:54:12 +0000 (07:54 +0100)]
Walking the page lists needs the page_alloc lock
There are a few places in Xen where we walk a domain's page lists
without holding the page_alloc lock. They race with updates to the
page lists, which are normally rare but can be quite common under PoD
when the domain is close to its memory limit and the PoD reclaimer is
busy. This patch protects those places by taking the page_alloc lock.
I think this is OK for the two debug-key printouts - they don't run
from irq context and look deadlock-free. The tboot change seems safe
too unless tboot shutdown functions are called from irq context or
with the page_alloc lock held. The p2m one is the scariest but there
are already code paths in PoD that take the page_alloc lock with the
p2m lock held so it's no worse than existing code.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Gianni Tedesco [Tue, 27 Jul 2010 17:09:22 +0000 (18:09 +0100)]
libxl: Move PCI specific functions to libxl_pci.c
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Christoph Egger [Tue, 27 Jul 2010 16:55:20 +0000 (17:55 +0100)]
libxl: const-correctness fix to device_physdisk_major_minor
device_physdisk_major_minor does not intend to modify physpath.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 27 Jul 2010 16:20:23 +0000 (17:20 +0100)]
xl: simplify configuration parsing with local variables
Replace repeated patterns of "d_config->THING[d_config->num_THING]"
with a single local variable.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 27 Jul 2010 16:17:09 +0000 (17:17 +0100)]
xl: move device structs into struct domain_config
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 27 Jul 2010 16:09:11 +0000 (17:09 +0100)]
xl: move create and build info to struct domain_config
All three are passed around together and this begins to reduce some of
the exceptionally long parameter lists.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 27 Jul 2010 16:08:11 +0000 (17:08 +0100)]
xl: implement "rename-restart" action for shutdown
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 27 Jul 2010 16:07:22 +0000 (17:07 +0100)]
libxl: add libxl_domain_preserve
This method is intended to preserve an existing (but shut down) domain
(for debugging purposes) in such a way that the domain can also be
restarted.
There is likely to be more required to achieve this aim than the
function currently does.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Tue, 27 Jul 2010 16:06:14 +0000 (17:06 +0100)]
xl: support on_{poweroff,reboot,crash} domain configuration options.
Adds on_watchdog compared to xend.
I have further plans for struct domain_config so it isn't as pointless
as it first looks.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Ian Jackson [Fri, 23 Jul 2010 18:14:53 +0000 (19:14 +0100)]
Merge
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.
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.
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>
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>
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>
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>
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>
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>
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>
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>
"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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
Keir Fraser [Tue, 20 Jul 2010 16:56:07 +0000 (17:56 +0100)]
Merge
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>
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>
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>
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>
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>
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>
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>
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>
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>
Keir Fraser [Mon, 19 Jul 2010 17:56:02 +0000 (18:56 +0100)]
Merge
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Keir Fraser [Fri, 16 Jul 2010 16:44:04 +0000 (17:44 +0100)]
Merge
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>
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>
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>
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>
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>
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>