aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl
Commit message (Collapse)AuthorAgeFilesLines
...
* libxl: regenerate libxlu cfg parser after 9e14c516b6cbIan Campbell2013-04-122-30/+30
| | | | | | Fixup whitespace alignment while I'm there. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* xl: fix xl config parserChoonho Son2013-04-111-1/+1
| | | | | | | | | | | Bug: xl lexical analyzer cannot parse keyword which has .(dot) character like vif.default.script ref: 733b9c524dbc2bec318bfc3588ed1652455d30ec Error log: /etc/xen/xl.conf:28: config parsing error near `.default.script="vif-bridge"': lexical error Signed-off-by: Choonho Son <choonho.son@gmail.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Roger Pau Monne <roger.pau@citrix.com>
* xl: Accept a list for usbdevice in config fileGeorge Dunlap2013-04-081-2/+18
| | | | | | | | | | | | | | | | | | | | Allow the "usbdevice" key to accept a list of USB devices, and pass them in using the new usbdevice_list domain build element. For backwards compatibility, still accept singleton values. Also update the xl.cfg manpage, adding information about how to pass through host devices. as applied: - Fix trailing whitespace and wrap some lines in xl_cmdimpl.c -iwj v2: - Add some verbiage to make it clear that "usb" is for emulated devices - Reference qemu manual for more usbdevice options Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Allow multiple USB devices on HVM domain creationGeorge Dunlap2013-04-083-2/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows an HVM domain to be created with multiple USB devices. Since the previous interface only allowed the passing of a single device, this requires us to add a new element to the hvm struct of libxl_domain_build_info -- usbdevice_list. For API compatibility, the old element, usbdevice, remains. If hvm.usbdevice_list is set, each device listed will cause an extra "-usbdevice [foo]" to be appended to the qemu command line. Callers may set either hvm.usbdevice or hvm.usbdevice_list, but not both; libxl will throw an error if both are set. In order to allow users of libxl to write software compatible with older versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST. If this is defined, callers may use either hvm.usbdevice or hvm.usbdevice_list; otherwise, only hvm.usbdevice will be available. as applied: - Fix whitespace errors -iwj v3: - Duplicate functionality in both "new" and "old", since we're not unifying the two anymore. v2: - Throw an error if both usbdevice and usbdevice_list are set - Update and clarify definition based on feedback - Previous patches means this works for both traditional and upstream Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: default autoballoon option to "auto"David Vrabel2013-04-081-2/+4
| | | | | | | | In xl.conf, autoballoon="auto" will do the right thing for most people. Make it the default (instead of "on"). Signed-off-by: David Vrabel <david.vrabel@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: extend autoballoon xl.conf option with an "auto" optionDavid Vrabel2013-04-081-2/+34
| | | | | | | | | | | | | | | | | | autoballoon=1 is not recommened if dom0_mem was used to reduce the amount of dom0 memory. Instead of requiring users to change xl.conf if they do this, extend the autoballoon option with a new choice: "auto". With autoballoon="auto", autoballooning will be disabled if dom0_mem was used on the Xen command line. For consistency, accept "on" and "off" as valid autoballoon options (1 and 0 are still accepted). The default remains "on" for now. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: run libxl__arch_domain_create() much earlier.Tim Deegan2013-03-284-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Among other things, arch_domain_create() sets the shadow(/hap/p2m) memory allocation, which must happen after vcpus are assigned (or the shadow op will fail) but before memory is allocated (or we might run out of p2m memory). libxl__build_pre(), which already sets similar things like maxmem, semes like a reasonable spot for it. That needed a bit of plumbing to get the right datastructure from the caller. As a side-effect, the return code from libxl__arch_domain_create() is no longer ignored. This bug was analysed in: From: "Jan Beulich" <JBeulich@xxxxxxxx> "Re: [Xen-devel] [xen-unstable test] 16788: regressions - FAIL" Date: Mon, 04 Mar 2013 16:34:53 +0000 http://lists.xen.org/archives/html/xen-devel/2013-03/msg00191.html Reported-by: Jan Beulich <JBeulich@suse.com> Signed-off-by: Tim Deegan <tim@xen.org> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com>
* libxl: Streamline vnc argument generation codeGeorge Dunlap2013-03-251-29/+50
| | | | | | | | | | Makes the following changes to the vnc generation code: * Simplifies and comments it, making it easier to read and grok * Throws an error if duplicate values of display are set, rather than the current very un-intuitive behavior. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: add vif.default.scriptRoger Pau Monne2013-03-151-1/+10
| | | | | | | | | | | Replace vifscript with vif.default.script. The old config option is kept for backwards compatibility. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: George Dunlap <george.dunlap@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: add vif.default.bridgeRoger Pau Monne2013-03-151-2/+11
| | | | | | | | | | | This is a replacement for defaultbridge xl.conf option. The now deprecated defaultbridge is still supported. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: George Dunlap <George.Dunlap@eu.citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: allow specifying a default gatewaydev in xl.confRoger Pau Monne2013-03-153-0/+20
| | | | | | | | | | | | | | This adds a new global option in the xl configuration file called "vif.default.gatewaydev", that is used to specify the default gatewaydev to use when none is passed in the vif specification. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Ulf Kreutzberg <ulf.kreutzberg@hosteurope.de> Cc: Ulf Kreutzberg <ulf.kreutzberg@hosteurope.de> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: George Dunlap <george.dunlap@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl/libxl: add gatewaydev/netdev to vif specificationRoger Pau Monne2013-03-154-2/+28
| | | | | | | | | | | | | | | | | | This option is used by the vif-route hotplug script. A new more descriptive name is used, "gatewaydev", but "netdev" is also supported as a deprecated backwards compatible option. This option was supported in the past, according to http://wiki.xen.org/wiki/Vif-route, so we should also support it in libxl. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Ulf Kreutzberg <ulf.kreutzberg@hosteurope.de> Cc: Ulf Kreutzberg <ulf.kreutzberg@hosteurope.de> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: George Dunlap <george.dunlap@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: libxl: unbreak build after ec41430ef6a7Ian Campbell2013-03-141-2/+2
| | | | | | | | | | | | | | | | | | libxl_create.c: In function ‘libxl__domain_build_info_setdefault’: libxl_create.c:109: error: ‘info’ undeclared (first use in this function) libxl_create.c:109: error: (Each undeclared identifier is reported only once libxl_create.c:109: error: for each function it appears in.) cc1: warnings being treated as errors libxl_create.c:108: error: suggest explicit braces to avoid ambiguous ‘else’ libxl_create.c: At top level: libxl_create.c:141: error: expected identifier or ‘(’ before ‘if’ ... Fix is to insert the missing opening brace and s/info/b_info/ in one spot. 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>
* libxl: use qemu-xen (upstream QEMU) as device model by defaultStefano Stabellini2013-03-134-3/+19
| | | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: move check for existence of qemuu device modelIan Jackson2013-03-131-5/+8
| | | | | | | | | | | | | | The stat in libxl__domain_build_info_setdefault's default device model logic works to fall back to qemu-xen-traditional whenever the executable for qemu-xen is not found. We are going to use qemu-xen-traditional in more cases, so break this check out into its own if statement. Also add a pair of braces to make the if() statement symmetrical. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: move libxl_device_action to idlRoger Pau Monne2013-03-136-24/+25
| | | | | | | | Move to idl for ease of expansion and auto-generated functions. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: remove double check in NetBSD hotplugRoger Pau Monne2013-03-131-4/+0
| | | | | | | | | Remove a duplicated check performed in libxl__get_hotplug_script_info for NetBSD Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: don't launch more than one tapdisk process for each diskRoger Pau Monne2013-03-131-7/+10
| | | | | | | | | | | When adding a disk don't launch multiple tapdisk instances for the same disk, if transaction fails in device_disk_add reuse the same tapdisk for further tries instead of creating a new instance each time a transaction fails. Reported-by: Darren Shepherd <darren.s.shepherd@gmail.com> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Tested-by: Darren Shepherd <darren.s.shepherd@gmail.com>
* libxl: Made it possible to use 'timer='delay_for_missed_ticks'Konrad Rzeszutek Wilk2013-02-261-1/+1
| | | | | | | | | | The assertion only allows values of 1 (no_delay_for_missed_ticks) up to 3 (one_missed_tick_pending). It should be possible to use the value of 0 (delay_for_missed_ticks) for the timer configuration option. Acked-by: Ian Campbell <ian.cambell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* libxl: fix build on 32-bitIan Campbell2013-02-211-2/+2
| | | | | | | | | | | | | | aab4d1b266ce "libxl: Add qxl vga interface support for upstream qemu" introduced: libxl_dm.c: In function ‘libxl__build_device_model_args_new’: libxl_dm.c:449: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’ libxl_dm.c:451: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’ on arm32 and x86_32. Use the inttypes.h PRId64 macro. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Add qxl vga interface support for upstream qemuFabio Fantoni2013-02-204-11/+38
| | | | | | | | | | | Usage: vga="qxl" Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it> Signed-off-by: Zhou Peng <zpengxen@gmail.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>
* tools/libxl: Disable useless empty floppy drive with qemu-xenFabio Fantoni2013-02-151-0/+3
| | | | | | Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools/libxl: Improve videoram settingFabio Fantoni2013-02-152-1/+23
| | | | | | | | | | | | | - If videoram setting is less than 8 mb shows error and exit. - Added videoram setting for qemu upstream with cirrus (added in qemu 1.3). - Updated xl.cfg man. - Default and minimal videoram changed to 16 mb if stdvga is set and upstream qemu is being used. This is required by qemu 1.4 to avoid a xen memory error (qemu 1.3 doesn't complain about it, probably buggy). Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools/libxl: Added vga parameter for hvm domUsFabio Fantoni2013-02-151-1/+13
| | | | | | | | | | | | | | Usage: vga="stdvga"|"cirrus" - Default option is cirrus. - Prints error and exit if unknown value is passed. - stdvga parameter is now deprecated. - Updated xl.cfg man. Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: compile and run libxl/xlStefano Stabellini2013-02-152-47/+55
| | | | | | | | | | | | Move tsc, rtc, memmap_limit, localtime and shadow settings from libxl__build_pre to libxl__arch_domain_create. Get the console and xenstore pfn's from struct xc_dom_image for autotranslated guests. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Cleanup, use LOG* and GCSPRINTF macro in libxl_dom.cRoss Philipson2013-02-151-58/+39
| | | | | | Signed-off-by: Ross Philipson <ross.philipson@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: HVM firmware passthrough supportRoss Philipson2013-02-154-17/+129
| | | | | | | | | | | | | | | | | | | | | | This patch introduces support for two new parameters in libxl: smbios_firmware=<path_to_smbios_structures_file> acpi_firmware=<path_to_acpi_tables_file> The changes are primarily in the domain building code where the firmware files are read and passed to libxc for loading into the new guest. After the domain building call to libxc, the addresses for the loaded blobs are returned and written to xenstore. LIBXL_HAVE_FIRMWARE_PASSTHROUGH is defined in libxl.h to allow users to determine if the feature is present. This patch also updates the xl.cfg man page with descriptions of the two new parameters for firmware passthrough. Signed-off-by: Ross Philipson <ross.philipson@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: switch to using the new xc_hvm_build() libxc API.Ross Philipson2013-02-151-6/+13
| | | | | | Signed-off-by: Ross Philipson <ross.philipson@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: pass debug flag down to libxl_domain_suspendOlaf Hering2013-02-152-7/+15
| | | | | | | | | | | | libxl_domain_suspend is already prepared to handle LIBXL_SUSPEND_DEBUG, and xl migrate handles the -d switch as well. Pass this flag down to libxl_domain_suspend, so that finally xc_domain_save can dump huge amount of debug data to stdout. Update xl.1 and help text output. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: correct help text of xl migrateOlaf Hering2013-02-151-1/+1
| | | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools: Fix memset(&p,0,sizeof(p)) idiom in several places.Michael Young2013-02-131-1/+1
| | | | | | | | | gcc 4.8 identifies several places where code of the form memset(x, 0, sizeof(x)); is used incorrectly, meaning that less memory is set to zero than required. Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Committed-by: Keir Fraser <keir@xen.org>
* libxl: fix xcflags assignment in libxl__domain_suspendOlaf Hering2013-02-051-3/+3
| | | | | | | | | Currently ->xcflags remains 1 because the braces are placed incorrectly. Put each logical unit into its own braces to fix assigment to xcflags. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: SWITCH_FOREACH_OPT handles special options directly.Ian Campbell2013-01-251-145/+51
| | | | | | | | | | This removes the need for the "case 0: case 2:" boilerplate in every main_foo(). Calls exit(3) directly which is OK since xl cleans up the context etc in an atexit(3) handler. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: Introduce helper macro for option parsing.Ian Campbell2013-01-251-444/+528
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: allow def_getopt to handle long optionsIan Campbell2013-01-251-198/+125
| | | | | | | | | | | | | Improves consistency of option parsing and error handling. Consistently support --help for all options. Many users of getopt_long were needlessly passing an option_index pointer which was not used. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: libxl__prepare_ao_device should reset num_execRoger Pau Monne2013-01-251-0/+1
| | | | | | | | num_exec was not cleared when calling libxl__prepare_ao_device. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix stale timeout event callback raceIan Jackson2013-01-242-77/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because there is not necessarily any lock held at the point the application (eg, libvirt) calls libxl_osevent_occurred_timeout, in a multithreaded program those calls may be arbitrarily delayed in relation to other activities within the program. Specifically this means when ->timeout_deregister returns, libxl does not know whether it can safely dispose of the for_libxl value or whether it needs to retain it in case of an in-progress call to _occurred_timeout. The interface could be fixed by requiring the application to make a new call into libxl to say that the deregistration was complete. However that new call would have to be threaded through the application's event loop; this is complicated and some application authors are likely not to implement it properly. Furthermore the easiest way to implement this facility in most event loops is to queue up a time event for "now". Shortcut all of this by having libxl always call timeout_modify setting abs={0,0} (ie, ASAP) instead of timeout_deregister. This will cause the application to call _occurred_timeout. When processing this calldown we see that we were no longer actually interested and simply throw it away. Additionally, there is a race between _occurred_timeout and ->timeout_modify. If libxl ever adjusts the deadline for a timeout the application may already be in the process of calling _occurred, in which case the situation with for_app's lifetime becomes very complicated. Therefore abolish libxl__ev_time_modify_{abs,rel} (which have no callers) and promise to the application only ever to call ->timeout_modify with abs=={0,0}. The application still needs to cope with ->timeout_modify racing with its internal function which calls _occurred_timeout. Document this. This is a forwards-compatible change for applications using the libxl API, and will hopefully eliminate these races in callback-supplying applications (such as libvirt) without the need for corresponding changes to the application. (It is possible that this might expose bugs in applications, though, as previously libxl would never call libxl_osevent_hooks->timeout_modify and now it never calls ->timeout_deregister). For clarity, fold the body of time_register_finite into its one remaining call site. This makes the semantics of ev->infinite slightly clearer. Cc: Bamvor Jian Zhang <bjzhang@suse.com> Cc: Ian Campbell <Ian.Campbell@citrix.com> Tested-by: Jim Fehlig <jfehlig@suse.com> Acked-by: Jim Fehlig <jfehlig@suse.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix stale fd event callback raceIan Jackson2013-01-242-29/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because there is not necessarily any lock held at the point the application (eg, libvirt) calls libxl_osevent_occurred_timeout and ..._fd, in a multithreaded program those calls may be arbitrarily delayed in relation to other activities within the program. libxl therefore needs to be prepared to receive very old event callbacks. Arrange for this to be the case for fd callbacks. This requires a new layer of indirection through a "hook nexus" struct which can outlive the libxl__ev_foo. Allocation and deallocation of these nexi is mostly handled in the OSEVENT macros which wrap up the application's callbacks. Document the problem and the solution in a comment in libxl_event.c just before the definition of struct libxl__osevent_hook_nexus. There is still a race relating to libxl__osevent_occurred_timeout; this will be addressed in the following patch. Reported-by: Bamvor Jian Zhang <bjzhang@suse.com> Cc: Bamvor Jian Zhang <bjzhang@suse.com> Cc: Ian Campbell <Ian.Campbell@citrix.com> Tested-by: Jim Fehlig <jfehlig@suse.com> Acked-by: Jim Fehlig <jfehlig@suse.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: correct xenstore permissions on console deviceDaniel De Graaf2013-01-171-0/+2
| | | | | | | | | | When the console is connected to a domain other than dom0, the console device's backend field should be set so the xenstore permissions for the console device reflect the domain that will be accessing them. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: don't continue to create the domain if the device model is not spawnedJulien Grall2013-01-171-2/+0
| | | | | | | | | | | When the device model can't be spawned, rc variable is cleared in device_model_spawn_outcome (libxl_dm.c). In this case libxl will continue to create the domain and let it between life and death. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* fix wrong path while calling pygrub and libxl-save-helperBamvor Jian Zhang2013-01-112-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | in current xen x86_64, the default libexec directory is /usr/lib/xen/bin, while the private binder is /usr/lib64/xen/bin. but some commands(pygrub, libxl-save-helper) located in private binder directory is called from libexec directory which lead to the following error: 1, for pygrub bootloader: libxl: debug: libxl_bootloader.c:429:bootloader_disk_attached_cb: /usr/lib/xen/bin/pygrub doesn't exist, falling back to config path 2, for libxl-save-helper: libxl: cannot execute /usr/lib/xen/bin/libxl-save-helper: No such file or directory libxl: error: libxl_utils.c:363:libxl_read_exactly: file/stream truncated reading ipc msg header from domain 3 save/restore helper stdout pipe libxl: error: libxl_exec.c:118:libxl_report_child_exitstatus: domain 3 save/restore helper [10222] exited with error status 255 there are two ways to fix above error. the first one is make such command store in the /usr/lib/xen/bin and /usr/lib64/xen/bin(symbol link to previous), e.g. qemu-dm. The second way is using private binder dir instead of libexec dir. e.g. xenconsole. For these cases, the latter one is suitable. Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Set vfb and vkb devid if not done so by the callerJim Fehlig2013-01-111-20/+39
| | | | | | | | | | | Other devices set a sensible devid if the caller has not done so. Do the same for vfb and vkb. While at it, factor out the common code used to determine a sensible devid, so it can be used by other libxl__device_*_add functions. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: move definition of libxl_domain_config into the IDLIan Campbell2012-12-194-209/+17
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: introduce XSM relabel on buildDaniel De Graaf2012-12-133-1/+24
| | | | | | | | | | | | | | | | | | | | | | Allow a domain to be built under one security label and run using a different label. This can be used to prevent the domain builder or control domain from having the ability to access a guest domain's memory via map_foreign_range except during the build process where this is required. Example domain configuration snippet: seclabel='customer_1:vm_r:nomigrate_t' init_seclabel='customer_1:vm_r:nomigrate_t_building' Note: this does not provide complete protection from a malicious dom0; mappings created during the build process may persist after the relabel, and could be used to indirectly access the guest's memory. However, if dom0 correctly unmaps the domain upon building, a the domU is protected against dom0 becoming malicious in the future. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: qemu trad logdirty: Tolerate ENOENT on ret pathIan Jackson2012-12-131-1/+1
| | | | | | | | | | | It can happen in error conditions that lds->ret_path doesn't exist, and libxl__xs_read_checked signals this by setting got_ret=NULL. If this happens, fail without crashing. Reported-by: Alex Bligh <alex@alex.org.uk>, Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Make an internal function explicitly check existence of expected pathsGeorge Dunlap2012-12-061-20/+47
| | | | | | | | | | | | | | | | | | | | | | | libxl__device_disk_from_xs_be() was failing without error for some missing xenstore nodes in a backend, while assuming (without checking) that other nodes were valid, causing a crash when another internal error wrote these nodes in the wrong place. Make this function consistent by: * Checking the existence of all nodes before using * Choosing a default only when the node is not written in device_disk_add() * Failing with log msg if any node written by device_disk_add() is not present * Returning an error on failure * Disposing of the structure before returning using libxl_device_disk_displose() Also make the callers of the function pay attention to the error and behave appropriately. In the case of libxl__append_disk_list_of_type(), this means only incrementing *ndisks as the disk structures are successfully initialized. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: Check for duplicate vncdisplay options, and return an errorGeorge Dunlap2012-12-041-0/+11
| | | | | | | | | | | If the user has set a vnc display number both in vnclisten (with "xxxx:yy"), and with vncdisplay, throw an error. Update man pages to match. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix wrong commentRoger Pau Monne2012-12-041-1/+1
| | | | | | | | | The comment in function libxl__try_phy_backend is wrong, 1 is returned if the backend should be handled as "phy", while 0 is returned if not. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore dataGeorge Dunlap2012-11-271-1/+16
| | | | | | | | | | | | | | | | | libxl_cdrom_insert was failing to initialize the backend type, resulting in the wrong default backend. The result was not only that the CD was not inserted properly, but also that some improper xenstore entries were created, causing further block commands to fail. This patch fixes the bug by setting the disk backend type based on the type of the existing device. It also makes the system more robust by checking to see that it has got a valid path before proceeding to write a partial xenstore entry. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: fix a variable underflow in libxl_wait_for_free_memoryRonny Hegewald2012-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | When xl is called to create a domU and there is not enough memory available, then the autoballooning is called to extract memory from dom0. During the ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory is available to create the domU. But because of a variable-underflow the loop can finish too soon and xl finally aborts with the message: xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: Device or resource busy libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build domain: -3 The variable-underflow happens when freemem_slack is larger then info.free_pages*4, because the solution of this operation is converted implicit to a unsigned int to match the type of memory_kb. Add a extra check for this condition to solve the problem. Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>