xl: Use gcc hidden visibility attribute
This kills off about 1,000 PLT entries speeding up link time and shaving about
1-2KB off of binary size. It also prevents users of the library erroneously
calling libxl internal functions.
xl: Fix invalid return of internal ptrs via libxl_poolid_to_name
libxl_poolid_to_name has in-and-out-of-library callers. In library callers now use
_libxl_poolid_to_name() which participates in garbage collection and
out-of-library callers are fixed up to free() the domain name.
xl: Fix invalid return of libxl-internal pointers via libxl_domid_to_name()
libxl_domid_to_name has numerous in-and-out-of-library callers. In
library callers now use _libxl_domid_to_name() which participates in
garbage collection and out-of-library callers are fixed up to free() the
domain name.
xl: don't use libxl allocator for nic_list
This also fixes a bug with an erroneous call to libxl_free().
A destructor for the nic list is also implemented which is called from
xl.
xl: allocate version info strings with strdup()
libxl_strdup() will soon have a per-call rather than per-context lifetime so
use strdup() to allocate version info and manually free in context destructor
xl: Return void from libxl_free() and libxl_free_all()
Also abort() if a pointer passed in to libxl_free() cannot be found in the
mini-gc structures. This exposes several real bugs (ie. not just the
libxl_free() something that was allocated via malloc variety).
Andre Przywara [Tue, 10 Aug 2010 14:35:13 +0000 (15:35 +0100)]
xl: Fix xl vcpu-list output on machines with more than 16 cores Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xc_vcpu_[sg]etaffinity require the number of _bytes_ needed for
holding a CPU map, not the number of bits. Fix this when
calling the function from libxl and rename the misleading variable
name to avoid future confusion.
Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Implement PCI pass-through for multi-function devices. The supported BDF
notation is: BB:DD.* - therefore passing-through a subset of functions or
remapping the function numbers is not supported except for when passing
through a single function which will be a virtual function 0.
Letting qemu automatically select the virtual slot is not supported in
multi-function passthrough since the qemu-dm protocol can not actually
handle that case.
Gianni Tedesco [Mon, 9 Aug 2010 16:43:18 +0000 (17:43 +0100)]
xc: fix segfault in pv domain create if kernel is an invalid image
If libelf calls elf_err() or elf_msg() before elf_set_log() has been
called then it could potentially read an uninitialised log handling
callback function pointer from struct elf_binary. Fix this in libxc by
zeroing the structure before calling elf_init().
The error message when one wants to list a non-existent domain is at
best misleading (libxl_domain_info failed (code -5)).
This patch catches this specific error and tells the user that the
requested domain does not exist:
Error: Domain '42' does not exist.
Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Anthony Perard [Mon, 9 Aug 2010 15:46:02 +0000 (16:46 +0100)]
tools/hotplug, Use udev rules instead of qemu script to setup the bridge.
From: Anthony PERARD <anthony.perard@citrix.com>
This patch adds a second argument to vif-bridge script. It can be "vif"
or "tap". "vif" give the default behavior and "tap" just add the
interface to the found bridge when the action is "add".
Anthony Perard [Mon, 9 Aug 2010 15:46:01 +0000 (16:46 +0100)]
libxl, Introduce the command line handler for the new qemu.
From: Anthony PERARD <anthony.perard@citrix.com>
This patch adds a function to check the version of the device model.
Depending on the version of the DM, the command line arguments will be
built differently.
Creates a shared memory ring buffer and event channel in HVM domains
for passing debug messages from PV drivers on HVM guests
The console is used by windows pv drivers to send debug data to xenconsoled
Signed-off-by: Owen Smith <owen.smith@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Campbell [Wed, 4 Aug 2010 15:00:13 +0000 (16:00 +0100)]
libxl: free values in XLU_ConfigSetting.
Fixes these valgrind reported leaks, found with "valgrind xl create -n ..."
==21170== 8 bytes in 3 blocks are definitely lost in loss record 1 of 3
==21170== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21170== by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21170== by 0x4030085: xlu__cfgl_strdup (libxlu_cfg.c:290)
==21170== by 0x402F3C4: xlu__cfg_yylex (libxlu_cfg_l.l:37)
==21170== by 0x402DD86: xlu__cfg_yyparse (libxlu_cfg_y.c:1338)
==21170== by 0x40308AE: xlu_cfg_readdata (libxlu_cfg.c:85)
==21170== by 0x804DBE4: parse_config_data (xl_cmdimpl.c:591)
==21170== by 0x8056EE4: create_domain (xl_cmdimpl.c:1381)
==21170== by 0x80582AE: main_create (xl_cmdimpl.c:3178)
==21170== by 0x804B54B: main (xl.c:76)
==21170==
==21170== 57 bytes in 2 blocks are definitely lost in loss record 2 of 3
==21170== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21170== by 0x402FE22: xlu__cfgl_dequote (libxlu_cfg.c:307)
==21170== by 0x402F4B4: xlu__cfg_yylex (libxlu_cfg_l.l:52)
==21170== by 0x402DD86: xlu__cfg_yyparse (libxlu_cfg_y.c:1338)
==21170== by 0x40308AE: xlu_cfg_readdata (libxlu_cfg.c:85)
==21170== by 0x804DBE4: parse_config_data (xl_cmdimpl.c:591)
==21170== by 0x8056EE4: create_domain (xl_cmdimpl.c:1381)
==21170== by 0x80582AE: main_create (xl_cmdimpl.c:3178)
==21170== by 0x804B54B: main (xl.c:76)
==21170==
==21170== 111 bytes in 6 blocks are definitely lost in loss record 3 of 3
==21170== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21170== by 0x402FE22: xlu__cfgl_dequote (libxlu_cfg.c:307)
==21170== by 0x402F4ED: xlu__cfg_yylex (libxlu_cfg_l.l:56)
==21170== by 0x402DD86: xlu__cfg_yyparse (libxlu_cfg_y.c:1338)
==21170== by 0x40308AE: xlu_cfg_readdata (libxlu_cfg.c:85)
==21170== by 0x804DBE4: parse_config_data (xl_cmdimpl.c:591)
==21170== by 0x8056EE4: create_domain (xl_cmdimpl.c:1381)
==21170== by 0x80582AE: main_create (xl_cmdimpl.c:3178)
==21170== by 0x804B54B: main (xl.c:76)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Gianni Tedesco [Wed, 4 Aug 2010 13:43:46 +0000 (14:43 +0100)]
xl: detect pci-insert-failed dm status on pci-passthrough
NOTE: This functionality depends on a corresponding qemu-dm patch to work as
expected. Should be safe to use with an un-patched qemu-dm as before.
libxl_wait_for_device_model can only wait for one status value, re-work the
API so that a callback function can chose between several different possible
status values for qemu-dm and fix up all callers appropriately.
In the case of PCI device insert we succeed if qemu-dm reports
"pci-device-inserted" and error out instead of hanging forever if it fails
since qemu-dm now reports a status of "pci-insert-failed".
Gianni Tedesco [Wed, 4 Aug 2010 13:43:00 +0000 (14:43 +0100)]
xl: implement pci attach to explicitly defined virtual PCI slot
Move to state-machine parser for PCI BDF's now that the number of possible
sscanf expressions is sufficiently large to make it worth it. Also implement
parsing of virtual PCI slot numbers.
Gianni Tedesco [Wed, 4 Aug 2010 13:24:19 +0000 (14:24 +0100)]
xl: centralize BDF parsing in to libxl
Introduce a new libxl call libxl_device_pci_parse_bdf() and use it
consistently.
This patch also fixes an infinite loop bug in xl create. If there is a
parse-error on any pci config file entry then xl will attempt to skip it, but
since num_pcidevs is used to index the config list and is not incremented when
skipping, this caused an infinite loop. Solve that problem by introducing a new
loop counter variable.
Note that virtual PCI slots are not parsed by the new code. However this is
a step towards support for virtual slots and multi-function device assignment
since only one location in the code will need to be changed now.
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
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>
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.
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>
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>
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.
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>
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>
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>
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.
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.
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>
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>
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>
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.
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>
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>
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>
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>
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>