aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_dm.c
Commit message (Collapse)AuthorAgeFilesLines
...
* libxl: Rationalise #includesIan Jackson2011-12-121-3/+1
| | | | | | | | | | | | | | | | | | | | libxl_internal.h now #includes libxl.h and various system headers. This 1. makes the order of header inclusion more predictable 2. explicitly allows libxl_internal.h to use objects defined in libxl.h 3. removes the need for individual files to include these headers Also - remove some unnecessary #includes of libxl_utils.h, flexarray.h, etc. in some libxl*.c files, - include libxl_osdeps.h at the top of libxl_internal.h - add missing includes of libxl_osdeps.h to a couple of files - change libxl.h to libxl_internal.h in a couple of files 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>
* libxl: Introduce migrate with the new QEMU.Anthony PERARD2011-12-011-2/+4
| | | | | | Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: open logs with O_APPENDIan Jackson2011-11-281-1/+1
| | | | | | | | Logfiles should always be opened for append. 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>
* libxl: add libxl__spawn_confirm_offspring_startupOlaf Hering2011-10-271-15/+6
| | | | | | | | | | | libxl__spawn_confirm_offspring_startup() is a generic version of libxl__confirm_device_model_startup(). Use libxl__spawn_confirm_offspring_startup for device model. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: add pid path to libxl__spawner_startingOlaf Hering2011-10-271-0/+1
| | | | | | | | | | | libxl_spawner_record_pid() should be able to write the pid to arbitrary paths. v2: - use const char* for ->pid_path, and update comment Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: rename dm_xenstore_record_pid to libxl_spawner_record_pidOlaf Hering2011-10-271-26/+1
| | | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: rename libxl__device_model_startingOlaf Hering2011-10-271-10/+10
| | | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: fixup incorrect indentationIan Campbell2011-10-121-0/+8
| | | | | | | | | Several places which were previsously indented using hard tabs are now incorrectly indented. Fix them up. 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: Introduce a QMP clientAnthony PERARD2011-09-291-0/+10
| | | | | | | | | | | | | | | QMP stands for QEMU Monitor Protocol and it is used to query information from QEMU or to control QEMU. This implementation will ask QEMU the list of chardevice and store the path to serial ports in xenstored. So we will be able to use xl console with QEMU upstream. In order to connect to the QMP server, a socket file is created in /var/run/xen/qmp-libxl-$(domid). Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: correct allocation size in libxl_list_vmIan Campbell2011-09-281-3/+3
| | | | | | | | | | | | | | *ptr has type libxl_vminfo not libxl_domid, so correct calloc call. This the second instance of this bug I've noticed recently, I did a quick audit of other similar uses of sizeof(...) and all I spotted were a couple of harmlessly reversed calloc arguments. It's a pretty strong argument for "foo = ..alloc(sizeof(*foo))" rather than "alloc(sizeof(foos_type))" though... 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: make libxl__wait_for_device_model use libxl__spawn_starrting directlyIan Campbell2011-09-271-1/+1
| | | | | | | | | | | | | | | | Instead of indirecting via libxl_device_model_starting. This fixes a segmentation fault using stubdomains where starting->for_spawn is (validly) NULL because starting a stubdom doesn't need to spawn a process. Most callers of libxl__wait_for_device_model already pass NULL for this variable (because they are not on the starting path) so on libxl__confirm_device_model_startup needs to change. Reported-by: Jeremy Fitzhardinge <jeremy@goop.org> 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: clean up trailing whitespaces in code.Wei Liu2011-07-191-3/+3
| | | | | | | | | Commit exactly the results of running find \! -iname '*.txt' -type f -print0 | xargs -0 perl -p -i.bak -E 's/\s+\n/\n/' Signed-off-by: Wei Liu <liuw@liuw.name> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: enabling upstream qemu as pure pv backend.Wei Liu2011-07-191-11/+27
| | | | | | | | | | | | | | | | | | This patch makes device_model_{version,override} work for pure pv guest, so that users can specify upstream qemu as pure pv backend other than traditional qemu-xen. This patch also adds device_model_args_{pv,hvm} options for pv and hvm guest respectively. Internally, original libxl__create_xenpv_qemu allocates a new empty dm_info (struct libxl_device_model_info) for every xenpv qemu created. Now the caller of libxl__create_xenpv_qemu is responsible for allocating this dm_info. Signed-off-by: Wei Liu <liuw@liuw.name> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: specify HVM vs PV in create_info using libxl_domain_type enumIan Campbell2011-07-181-1/+1
| | | | | | | | | Since libxl_init_build_info now needs an error return and a ctx (to log to) switch all libxl_init_*_info to have an int return and a ctx. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: specify HVM vs PV in build_info using libxl_domain_type enumIan Campbell2011-07-181-1/+2
| | | | | | | | | | Also caught one place (in libxl__domain_restore_common) which used info->u.hvm.pae even if !hvm. (fortunately the value was unused in xc_domain_restore). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: Give the HVM domain type the name "HVM"Ian Campbell2011-07-181-5/+5
| | | | | | | | | This is generally used in the Xen universe, rather than "FV" which is not used elsewhere. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: add LIBXL_MAC_{FMT,FMTLEN,BYTES}Ian Campbell2011-07-141-6/+4
| | | | | | | Modelled after LIBXL_UUID_... (where I also add FMTLEN). signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: sane disk backend selection and validationIan Jackson2011-07-061-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new function libxl__device_disk_set_backend which does some sanity checks and determines which backend ought to be used. If the caller specifies LIBXL_DISK_BACKEND_UNKNOWN (which has the value 0), it tries PHY, TAP and QDISK in that order. Otherwise it tries only the specified value. libxl__device_disk_set_backend (and its helper function disk_try_backend) inherit the role (and small amounts of the code) from validate_virtual_disk. This is called during do_domain_create and also from libxl_disk_device_add (for the benefit of hotplug devices). It also now takes over the role of the scattered fragments of backend selection found in libxl_device_disk_add, libxl_device_disk_local_attach and libxl__need_xenpv_qemu. These latter functions now simply do the job for the backend they find has already been specified and checked. The restrictions on the capabilities of each backend, as expressed in disk_try_backend (and to an extent in libxl_device_disk_local_attach) are intended to be identical to the previous arrangements. In 23618:3173b68c8a94 combined with 23622:160f7f39841b, 23623:c7180c353eb2, "xl" effectively became much more likely to select TAP as the backend. With this change to libxl the default backend selected by the libxl__device_disk_set_backend is intended to once again to be PHY where possible. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Ian Campbell <Ian.Campbell@citrix.com>
* libxl: use preferred syntax for network device creation with upstream qemuIan Campbell2011-05-261-6/+10
| | | | | | | | | | | | Markus Armbruster points out in <m3r582pzc1.fsf@blackfin.pond.sub.org> on qemu-devel that this is the prefered syntax going forward. Using it avoid needlessly instantiating a qemu "vlan" and instead creates a simply host end point and device. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: support "spice" (remote display protocol) with upstream qemuZhou Peng2011-05-261-0/+37
| | | | | | | | | | | | | | | | | | | | | | | This patch allows you to use spice for xen-upstream-qemu on upstream Xen or released Xen-4.1.0. Nothing need to be modified in xen-upstream-qemu, because qemu has include spice's code as a new feature since qemu-0.14. Usage: Add spice fields in VM cfg file. e.g. spice=1 spiceport=6000 spicehost='192.168.1.187' spicedisable_ticketing = 0 # default is 0 spicepasswd = 'password' spiceagent_mouse = 1 # default is 1 Signed-off-by: Zhou Peng <zhoupeng@nfs.iscas.ac.cn> 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>
* libxl: fix initialization of the disk parsing iteratorStefano Stabellini2011-05-241-1/+1
| | | | | | | | Fix the initialization of the disk parsing iterator. Signed-off-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>
* libxl: pass device model info down into HVM domain build functions.Ian Campbell2011-05-241-1/+1
| | | | | | | | | The builder will soon need to know the device model version in order to select the correct firmware. 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: libxl__xs_write format string should be const.Ian Campbell2011-05-241-3/+3
| | | | | | | | | | | | | | George Dunlap reports that gcc 4.4.3 complains: libxl_dm.c: In function libxl__create_device_mode: libxl_dm.c:776: error: format not a string literal and no format arguments And indeed the format argument here is a char * from libxl__domain_bios(). Make the argument to libxl__xs_write a const char * and change libxl__domain_bios to return a const char too. 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: add statup checks to libxl__wait_for_device_modelIan Campbell2011-05-241-4/+2
| | | | | | | | | | | | | | | When the device model is starting up push checks for spawn failure down into libxl__wait_for_device_model, allowing us to fail more quickly when the device model fails to start (e.g. due to a missing library or an early setup error etc). In order to allow the select loop in libxl__wait_for_device_model to wake when the child dies add pipe between the parent and the intermediate process which the intermediate process can use to signal the parent. 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: pass libxl__spawn_starting to libxl__spawn_spawn.Ian Campbell2011-05-241-1/+2
| | | | | | | | | | | | | | | | Passing a libxl__device_model_starting to a generic function and expecting it to scrobble inside for the generic data structure is a strange interface. Instead pass in a libxl__spawn_starting and an opaque hook data pointer. The for_spawn member of libxl__device_model_starting was annotated with "first!", suggesting that someone intended to use pointer casting tricks to move between the outer and inner struct. However the field is a pointer not a inline struct so this doesn't work (and it isn't used this way anyhow). Remove the comment, and move the field away from the front for good measure. 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: remove redundant call to libxl_domain_device_modelIan Campbell2011-05-241-3/+1
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: check that device model binary is executable.Ian Campbell2011-05-241-1/+6
| | | | | | | | | This causes us to fail more quickly in more obvious failure case of not having the right binary installed. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: Fix build failure with gcc 4.4.3-4ubuntu5George Dunlap2011-05-201-1/+1
| | | | | | | | c/s 23253:a3db6b91f32d causes build failure with gcc 4.4.3-4ubuntu5, as the compiler can't figure out that the value returned is always a string literal. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* libxl: make it possible to disable vncZhou Peng2011-05-201-2/+2
| | | | | | | | | | | | | | | | tools/libxl/libxl__build_device_model_args_new/old: The condition is so rigorous that user has no chance to disable the vnc, considering what has been done in parse_config_data() by default, which is not resonable with vnc option in vm-cfg file. I think, If user explicitly set "vnc=0", vnc should be disabled. User should have the chance to only use sdl, other remote display(spice) and even nothing. Signed-off-by: Zhou Peng <zhoupeng@nfs.iscas.ac.cn> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Fix apic/acpi confusionIan Jackson2011-05-171-2/+2
| | | | | | | | | | "apic" was written a couple of times where "acpi" was meant. Signed-off-by: Zhou Peng <zhoupeng@nfs.iscas.ac.cn> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: libxl: remove libxl_domain_build_state from the IDLIan Campbell2011-04-201-3/+3
| | | | | | | | | | | | | | This datastructure is internal to the library. Remove the reference from libxl_device_console. This could never have been used from outside libxl and is only used internally to add the primary PV console to a guest. Make an internal variant of libxl_device_console_add which takes the build state as a parameter instead. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: namespace enum values within their type.Ian Campbell2011-04-201-4/+4
| | | | | | | | | In other words the values for an enum type libxl_foo always take the form LIBXL_FOO_VALUE. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: generalize libxl_qemu_machine_type into libxl_domain_typeIan Campbell2011-04-201-10/+10
| | | | | | | | | The FV/PV distinction is not particular to the device model, although that remains the only user for now. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: move all enum values into the libxl namespaceIan Campbell2011-04-201-23/+31
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: support SeaBIOS. Use by default when upstream qemu is configured.Ian Campbell2011-04-201-2/+1
| | | | | | | | | | | | | | | | | The SeaBIOS integration here is only semi-complete and is targetted at developers and very early adopters who can be expected to cope with some rough edges. In particular the user must clone, patch as necessary and compile SeaBIOS themselves since this patchset does not cover any of that (in the same way we currently do not integrate upstream qemu clone+build). Include a big comment to that effect next to the Config.mk option. Many of the bios_config callback functions are not yet used by SeaBIOS. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: write selected BIOS to xenstore.Ian Campbell2011-04-201-0/+16
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: hide selection of device-model by default.Ian Campbell2011-04-201-18/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should never have been exposed to users as something they are required to think about, unless they want to. At the libxl API level: * Add libxl_device_model_info.device_model_version allowing the user to say which qemu version (e.g. old qemu-xen or qemu upstream) they want for a domain. * Add libxl_device_model_info.device_model_stubdomain allowing the user to select stub or non-stub device model * Default both the device_model field to NULL and DTRT when building a domain with that value in those fields, but still allow libxl users to specify something explicit if they want. * Note that libxl_device_model_info.device_model, if specified, must now be a complete path. At the xl level: * Support a new "device_model_version" option which sets the new libxl_device_model_info.device_model_version field. This option is mandatory if device_model_override is used. * Support a new "device_model_stubdomain_override" option which allows the user to request stubdomain if desired. * WARN if an HVM guest cfg uses the "device_model" config option, and direct users to the "device_model_override" option if they really do not want the default. If the "device_model" directive contains "stubdom-db" then direct users to the "device_model_stubdomain_override" directive. The default qemu remains the existing qemu-xen based qemu-dm and stubdomain defaults to off. I chose the name "qemu-xen traditional" to refer to the existing Xen fork of qemu and simply "qemu-xen" to refer to the new device model based on qemu upstream. I suspect that the vast majority of users only have these config options because they've copied them from somewhere and they normally have no interest in which device model is used. Renaming the fields and warning when they are used makes these decisions internal. This will allow us to make decisions at a platform level regarding the preferred hvmloader, device model, stub domain etc without requiring everyone to change their configuration files. Adding a device model version to the API is intended to make it easy for users to select what they need without having to know about the paths to specific binaries etc. Most importantly it gets rid of the parsing of the output of qemu -h... It's not clear where upstream qemu will eventually be installed, I went with /usr/bin/qemu for now. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* tools: libxl: hide selection of hvmloader by default.Ian Campbell2011-04-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | This should never have been exposed to users as something they are required to think about, unless they want to. At the libxl API level: * Move libxl_domain_build_info.kernel into the PV side of the tagged union (using this field to specify both PV kernel and hvmloader is confusing) * Add hvmloader (a string) to the HVM side of the tagged union. This defaults to NULL and libxl will DTRT with that default but still allow libxl users to specify something explicit if they want. At the xl level: * WARN if an HVM guest cfg uses the "kernel" config option, and direct users to the "hvmloader_override" option if they really do not want the default hvmloader. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* libxl: drop domid field from libxl_device_*Ian Campbell2011-04-081-5/+0
| | | | | | | | | | | | | | | | | | All functions which add a device to a domain already take a domid argument and the callers typically write the same value to the structure right before making the call. Functions which delete a device typically do not but adding this field makes the interface more consistent anyway and all callers have the domid to hand. All functions which return a libxl device structure are given a domid as a paramter and the caller therefore already knows which domain it is dealing with. 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: Drop unnecessary \n from log messageIan Campbell2011-04-051-1/+1
| | | | | | 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: specific explicit disk image format to new qemuIan Campbell2011-04-051-7/+30
| | | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: specify disks using supported command line syntax for new qemuIan Campbell2011-04-051-4/+40
| | | | | | | | | | | | | | | | | | | | | | The -hdX syntax is only retained for compatibility reasons and the -sdX syntax doesn't even exist. Additionally convert the first four non-SCSI disks to hd[a-d] and ignore any further non-SCSI disks (since qemu only supports 4 IDE devices). SCSI disks are passed through as is. qemu-xen was limited to 7 SCSI devices but upstream qemu supports 256, therefore do not limit the number of disks on the libxl side. qemu-xen did all this itself internally. Fixes "qemu: -xvda: invalid option" and allows PVHVM to work with upstream qemu. 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: pass list of disks to libxl__build_device_model_argsIan Campbell2011-04-051-16/+14
| | | | | | | | | | | | Given that we have the information available this is preferable to picking it out of xenstore instead. We already do this for VIFs. Only the qemu upstream version makes use of it since old qemu-xen actually parses xenstore itself. 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: Make all hidden/static functions take a gc not a ctxIan Campbell2011-03-151-97/+89
| | | | | | | | | | | | | | | | Also ensure that static and hidden functions use the libxl__ prefix not just libxl_ (in the case of static functions only when they use a libxl prefix to start with). This follows the policy described in libxl.h "libxl memory management". Based on a manual audit of: grep ^static tools/libxl/libxl*.[ch]| grep libxl_ctx grep libxl__ tools/libxl/*.h| grep libxl_ctx Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: do not start a xenpv qemu solely for tap devices if blktap is availableIan Campbell2011-03-151-2/+23
| | | | | | | | | | qemu is used as a fallback for DISK_BACKEND_TAP if no blktap is available but if blktap is available, or for DISK_BACKEND_PHY, we don't need a qemu process. 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: Call setsid(2) before exec'ing device modelJim Fehlig2011-03-101-0/+1
| | | | | | | | | | | | | While doing development on libvirt libxenlight driver I noticed that terminating a libxenlight client causes any qemu-dm processes that were indirectly created by the client to also terminate. Calling setsid(2) before exec'ing qemu-dm resolves the issue. Signed-off-by: Jim Fehlig <jfehlig@novell.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>
* libxl regression: don't require vncpasswd when password is empty stringChristoph Egger2011-02-181-1/+1
| | | | | | | | | | | Don't require an empty password when the guest config file has the entry vncpasswd='' Instead, do not require a password at all in this case. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: disk specification interface changeKamala Narasimhan2011-02-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Currently we pile all the backend and format information pertaining to disk option in a single enum. This check-in separates the two and uses two enums, one for disk format and another for disk backend. This helps clearly differentiate between disk format and backend within the implementation and also helps cleanup the code in this area in preparation for the impending parser revamping to be done post 4.1. Along with separating format and backend, this check-in also removes unwanted types and renames variables in the disk interface and fixes the code affected by the interface changes. In specific, here are the disk interface changes made - In libxl_device_disk structure physpath was renamed to pdev_path, virtpath was renamed to vdev, phystype was removed and replaced with backend and format enums. Also previously a single enum libxl_disk_phystype held the values for qcow, qcow2, vhd, aio, file, phy, empty and that got refactored into two enums, libxl_disk_format to hold unknown, qcow, qcow2, vhd, raw, empty and libxl_disk_backend to hold unknown, phy, tap and qdisk. Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: SECURITY: always honour request for vnc passwordIan Jackson2011-02-041-9/+16
| | | | | | | | | | | | | | | | | qemu only sets a password on its vnc display if the value for the -vnc option has the ",password" modifier. The code for constructing qemu-dm options was broken and only added this modifier for one of the cases. Unfortunately there does not appear to be any code for passing the vnc password to upstream qemu (ie, in the case where libxl_build_device_model_args_new is called). To avoid accidentally running the domain without a password, check for this situation and fail an assertion. This will have to be revisited after 4.1. Signed-off-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>
* libxl: pass gfx_passthru parameter to QEMUAllen Kay2011-02-021-0/+6
| | | | | | | | | Pass gfx_passthru parameter to QEMU. Keep it boolean for now as QEMU does not expect any other integer value. Signed-off-by: Allen Kay <allen.m.kay@intel.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>