aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_utils.h
Commit message (Collapse)AuthorAgeFilesLines
* libxl: introduce libxl_node_to_cpumapDario Faggioli2013-10-101-0/+3
| | | | | | | | As an helper for the special case (of libxl_nodemap_to_cpumap) when one wants the cpumap for just one node. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: postpone backend name resolutionDaniel De Graaf2013-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | This adds a backend_domname field in libxl devices that contain a backend_domid field, allowing either a domid or a domain name to be specified in the configuration structures. The domain name is resolved into a domain ID in the _setdefault function when adding the device. This change allows the backend of the block devices to be specified (which previously required passing the libxl_ctx down into the block device parser), and will simplify specification of backend domains in other users of libxl. The check on run_hotplug_scripts in parse_config_data is removed because it is a duplicate of the one in libxl__device_nic_setdefault, and is removed here because it no longer has the resolved domain ID to check. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- reran flex ]
* libxl: add vtpm supportMatthew Fioravante2012-11-131-0/+5
| | | | | | | | | | | | This patch adds vtpm support to libxl. It adds vtpm parsing to config files and 3 new xl commands: vtpm-attach vtpm-detach vtpm-list Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xl: do not leak cpupool names.Ian Campbell2012-09-141-0/+1
| | | | | | | | | | | | | | | | | | | | Valgrind reports: ==3076== 7 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==3076== at 0x402458C: malloc (vg_replace_malloc.c:270) ==3076== by 0x406F86D: libxl_cpupoolid_to_name (libxl_utils.c:102) ==3076== by 0x8058742: parse_config_data (xl_cmdimpl.c:639) ==3076== by 0x805BD56: create_domain (xl_cmdimpl.c:1838) ==3076== by 0x805DAED: main_create (xl_cmdimpl.c:3903) ==3076== by 0x804D39D: main (xl.c:285) And indeed there are several places where xl uses libxl_cpupoolid_to_name as a boolean to test if the pool name is valid and leaks the name if it is. Introduce an is_valid helper and use that instead. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Juergen Gross<juergen.gross@ts.fujitsu.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: introduce some node map helpersDario Faggioli2012-07-061-0/+23
| | | | | | | | | | | To allow for allocating a node specific libxl_bitmap (as it is for cpu number and maps). Helper unctions to convert a node map it its coresponding cpu map and vice versa are also implemented. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: expand the libxl_bitmap API a bitDario Faggioli2012-07-061-0/+4
| | | | | | | | By adding copying and *_is_full/*_is_empty facilities. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: rename libxl_cpumap to libxl_bitmapDario Faggioli2012-07-061-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | And leave to the caller the burden of knowing and remembering what kind of bitmap each instance of libxl_bitmap is. This is basically just some s/libxl_cpumap/libxl_bitmap/ (and some other related interface name substitution, e.g., libxl_for_each_cpu) in a bunch of files, with no real functional change involved. A specific allocation helper is introduced, besides libxl_bitmap_alloc(). It is called libxl_cpu_bitmap_alloc() and is meant at substituting the old libxl_cpumap_alloc(). It is just something easier to use in cases where one wants to allocate a libxl_bitmap that is going to serve as a cpu map. This is because we want to be able to deal with both cpu and NUMA node maps, but we don't want to duplicate all the various helpers and wrappers. While at it, add the usual initialization function, common to all libxl data structures. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.eu.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Add a gc to libxl_cpumap_alloc, ..._to_hex_stringIan Jackson2012-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | In the next patch we are going to change the definition of NOGC to require a local variable libxl__gc *gc. And this means that passing 0 to libxl__calloc is going to be wrong. libxl_cpumap_alloc doesn't have a gc but passes 0 to libxl_calloc Fix this by: - introducing an `out' label and an rc variable - replacing the returns with rc = ERROR_BLAH; goto out; - adding uses of GC_INIT and GC_FREE. - changing NULL to NOGC in the call to libxl__calloc Likewise fix libxl_cpumap_to_hex_string by: - adding a libxl_ctx* parameter and updating the one call site - adding uses of GC_INIT and GC_FREE. - changing NULL to NOGC in the call to libxl__zalloc Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Dario Faggioli <raistlin@linux.it> Acked-by: Roger Pau Monne <roger.pau@entel.upc.edu> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: allow setting more than 31 vcpusYang Zhang2012-06-281-1/+3
| | | | | | | | | | | | In current implementation, it uses integer to record current avail cpus and this only allows user to specify 31 vcpus. In following patch, it uses cpumap instead integer which make more sense than before. Also there is no limit to the max vcpus. Signed-off-by: Yang Zhang <yang.z.zhang@Intel.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: allow to allocate cpumap with specific sizeYang Zhang2012-06-281-1/+1
| | | | | | | | | | | | Currently, libxl_cpumap_alloc()allocate the cpumap with size of number of physical cpus. In some place, we may want to allocate specific size of cpumap. This patch allow to pass a argument to specific the size that you want to allocate. If pass 0, it means the size is equal to number of physical cpus. Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: child processes cleanupsIan Jackson2012-05-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Abolish libxl_fork. Its only callers were in xl. Its functionality is now moved elsewhere, as follows: * The "logging version of fork", which is what it was billed as, is now xl_fork, which also dies on failure. * Closing the xenstore handle in the child is now done in libxl__ev_child_fork, which is the only remaining place where fork is called in libxl. * We provide a new function libxl__ev_child_xenstore_reopen for in-libxl children to make the ctx useable for xenstore again. * Consequently libxl__spawn_record_pid now no longer needs to mess about with its own xenstore handle. As a bonus it can now just use libxl__xs_write. Also, since we have now converted all the forkers in libxl, we can always honour the fork_replacement childproc hook - so do so. 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: make libxl_create_logfile const-correctIan Jackson2012-05-111-1/+1
| | | | | | 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>
* xl block-detach: allow other than numeric-decimal specification of the diskJan Beulich2012-03-131-1/+1
| | | | | | | | ... to be in sync with block-attach. And rename the function. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: remove sysctl.h from public interfaceIan Campbell2012-03-011-2/+0
| | | | | | | | | Using sysctl.h is restricted to "node control tools only" and requires magic defines. Therefore make its use internal to libxl. Also removes an indirect include of domctl.h which has the same restrction. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: drop libxl_cpuarray -- topology was the only user.Ian Campbell2012-01-311-2/+0
| | | | | | 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: allow for specifying the CPU affinity in the config file.Dario Faggioli2012-01-271-0/+12
| | | | | | | | | Enable CPU affinity specification in a VM's config file with the exact syntax `xl vcpu-pin' provides. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: extend pCPUs specification for vcpu-pin.Dario Faggioli2012-01-271-0/+2
| | | | | | | | | | | | | | | | | | | | | Allow for "^<cpuid>" syntax while specifying the pCPUs list during a vcpu-pin. This enables doing the following: xl vcpu-pin 1 1 0-4,^2 and achieving: xl vcpu-list Name ID VCPU CPU State Time(s) CPU Affinity ... Squeeze_pv 1 1 3 -b- 2.4 0-1,3-4 ... Negative ranges are also supported, such as "0-4,^1-2" to mean "0,3-4" Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: libxl_devid_to_* should take an integer device idIan Campbell2011-10-181-4/+4
| | | | | | | | Currently takes a string. 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: fixup incorrect indentationIan Campbell2011-10-121-0/+7
| | | | | | | | | 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: clean up trailing whitespaces in code.Wei Liu2011-07-191-1/+1
| | | | | | | | | 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>
* tools: libxl: hide selection of device-model by default.Ian Campbell2011-04-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* libxl/xl: drop support for netchannel2Ian Campbell2011-04-081-5/+0
| | | | | | | | | | | | | | | | | netchannel2 was never widely deployed and no supported kernel includes either the front- or back-ends. The last known kernel with this support was the xen.git 2.6.31 branch which has been unsupported for ages. xl will warn the user if it spots a "vif2" configration item but otherwise support is completely removed. Work is ongoing to add the interesting features of netchannel2 as protocol extensions to netchannel1. 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: disk specification interface changeKamala Narasimhan2011-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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: correct error path in libxl_userdata_retrieveIan Jackson2011-01-281-1/+1
| | | | | | | | | | | | | Firstly, if libxl_read_file_contents fails, it doesn't really leave *data and *datalen_r undefined - it leaves them unchanged. Tighten up the spec for the benefit of libxl_userdata_retrieve. Secondly, libxl_userdata_retrieve ignored errors, assuming they were all ENOENT. Instead it should fail on unexpected errors. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Jim Fehlig <jfehlig@novell.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Specify the target ram size to Qemu (new) when calling itAnthony PERARD2011-01-061-0/+4
| | | | | | | | | | | This patch adds target_ram in device_model_info structure, to be used in libxl_build_device_model_args_new. Qemu upstream needs to know about it. It introduces also libxl__sizekb_to_mb to convert size from KB to MB by rounding up the result. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Implement libxl_basename()Christoph Egger2011-01-061-0/+1
| | | | | | | | | This patch implements libxl_basename() as a portable replacement for GNU vs. POSIX basename. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Support getting topology info in libxlJuergen Gross2010-12-091-0/+2
| | | | | | | | Added new function libxl_get_topologyinfo() to obtain this information from hypervisor. Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* tools: change cpumaps to uint8_tJuergen Gross2010-11-031-1/+3
| | | | | | | | | | | | | | | | | | | | Cpumap types in tools (libxc and libxl) are changed to be based on bytes like in the interface to the hypervisor. To make handling easier the size of used cpumaps is always based on the number of physical cpus supported by the hypervisor. This eliminates the need to keep track of the cpumap size in external interfaces. In libxl a macro for cycling through a cpumap is added (libxl_for_each_cpu). Interfaces changed: libxl_set_vcpuaffinity() libxl_cpumap_alloc() xc_vcpu_setaffinity() xc_vcpu_getaffinity() xc_cpupool_freeinfo() Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: cpupools: xl: commands and library changesJuergen Gross2010-10-211-2/+8
| | | | | | | | | | | | | | | Support of cpu pools in libxl and xl: library functions xl cpupool-create xl cpupool-list xl cpupool-destroy xl cpupool-cpu-add xl cpupool-cpu-remove xl cpupool-migrate Renamed all cpu pool related names to *cpupool* Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl, Introduce the command line handler for the new qemu.Anthony Perard2010-08-091-0/+6
| | | | | | | | | | | | | | | | 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. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- tools/libxl/libxl.c | 160 ++++++++++++++++++++++++++++++++++++++++++++- tools/libxl/libxl_utils.c | 78 ++++++++++++++++++++++ tools/libxl/libxl_utils.h | 6 ++ 3 files changed, 243 insertions(+), 1 deletions(-)
* libxl: consistently use typedef struct {} libxl_$typeIan Campbell2010-07-281-18/+18
| | | | | | | | 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>
* xl: network2-detach commandKeir Fraser2010-06-071-0/+3
| | | | | | Usage: xl network2-detach <Domain> <DevId> Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
* xl: network2-attach commandKeir Fraser2010-06-071-0/+1
| | | | | | | | | | Usage: xl network2-attach <Domain> [front_mac=<mac>] [back_mac=<mac>] [backend=<BackDomain>] [trusted=<0|1>] [back_trusted=<0|1>] [bridge=<bridge>] [filter_mac=<0|1>] [front_filter_mac=<0|1>] [pdev=<PDEV>] [max_bypasses=n] Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
* libxl: Use the caller's logger (xentoollog)Keir Fraser2010-05-281-7/+1
| | | | | | | | | | We now require callers to provide a xentoollog_logger* for libxl_ctx_init, and use that for all our own logging and also for xc_interface_open. Corresponding change to xl.c. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: Implement block-detach commandKeir Fraser2010-05-131-0/+3
| | | | Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
* xl: Implement network-detach commandKeir Fraser2010-05-131-0/+6
| | | | Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
* libxl: Support cpupoolsKeir Fraser2010-05-071-0/+2
| | | | Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* xl: Remove some duplicated boilerplate. (Improves logging slightly.)Keir Fraser2010-04-121-1/+1
| | | | | | | | | | | | | | | | | We remove six lines of boilerplate from the top of each function, and instead have a single struct libxl_ctx which is initialised once at the top of main. Likewise we wrap domain_qualifier_to_domid in a new function find_domain, which does the error handling, and stores the domid and the specified name (if applicable). This reduces the size of xl.c by 7% (!) As a beneficial side effect, the earlier call to libxl_ctx_set_log in main makes some lost messages appear. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Expose libxl_report_exitstatusKeir Fraser2010-04-121-0/+11
| | | | | | | | xl would like to use libxl_report_exitstatus, so expose it in libxl_utils.h to avoid having to write it twice. Also, give it a "level" argument to set the loglevel of the resulting message. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Expose functions for helping with subprocesses.Keir Fraser2010-04-121-0/+4
| | | | | | | | | | | | | | | | | | | | * Expose libxl_fork in libxl_utils.h * Expose libxl_pipe in libxl_utils.h * Make libxl_exec put SIGPIPE back (so that libxl callers may have SIGPIPE ignored) xl would like to use libxl_fork (which is like fork(2) except that it logs errors) and also a similar function libxl_pipe. So put these in libxl_utils.[ch] and use them in libxl.c as appropriate, to avoid having to duplicate code between xl and libxl. Also, make sure that subprocesses spawned by libxl have SIGPIPE set back to SIG_DFL as they are entitled to expect. This means that a libxl caller which sets SIGPIPE to SIG_IGN is no longer buggy. (This is relevant for xl migration, because xl would like to be such a caller.) Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: New utility functions in for reading and writing files.Keir Fraser2010-04-121-0/+18
| | | | | | | | | | | | | | | | | | | | | We introduce these functions in libxl_utils.h: int libxl_read_file_contents(struct libxl_ctx *ctx, const char *filename, void **data_r, int *datalen_r); int libxl_read_exactly(struct libxl_ctx *ctx, int fd, void *data, ssize_t sz, const char *filename, const char *what); int libxl_write_exactly(struct libxl_ctx *ctx, int fd, const void *data, ssize_t sz, const char *filename, const char *what); They will be needed by the following patches. They have to be in libxl.a rather than libxutil.a because they will be used, amongst other places, in libxl itself. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxenlight: separate logically list_vm and list_domainKeir Fraser2010-01-171-1/+1
| | | | | | | | | | | previously list_domain was something between listing VM and domains. provide 2 separates API calls to list domains and list vms. the list vms API filters utility domains like stubdomains, and domain 0 change is_stubdom to properly check the integer and also return a boolean value. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxenlight: remove any uuid dependancies from xlKeir Fraser2010-01-051-8/+0
| | | | | | | | | | | | | | | | | | | uuid handles in create and now create_device_model need to fill the uuid field by client. the uuid field happens to be the exact same size as the standard uuid (sixteen 8 bits values). stubdom need to have a uuid when created, so using the one in create_device_model. this permits the client library to generate the uuid in any way it see fits (even if it's not compliant to any standard), and simplify installation of the libxenlight header. xl converted from libuuid generated uuid to generated through random() C call. need to be fixed if anyone plan to use xl for anything seriously apart from developing libxl. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxenlight: implement cdrom insert/ejectKeir Fraser2009-12-081-0/+1
| | | | | | | | | | | This patch implements functions in libxenlight to change the cdrom in a VM at run time and to handle cdrom eject requests from guests. This patch adds two new commands to xl: cd-insert and cd-eject; it also modifies xl to handle cdrom eject requests coming from guests (actually coming from qemu). Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxenlight: move logging macros to the public headerKeir Fraser2009-11-251-0/+1
| | | | | | | | | | This patch moves the logging macros to the public header so that they can be reused by the client of the library. It also refactors the code to create the qemu logfile into a generic function that can be reused to create generic xen logfiles under /var/log/xen. Finally xl is changed to log to file when running in background. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxenlight: implement stubdom supportKeir Fraser2009-11-251-0/+2
| | | | | | | | | | | | | | | this patch implements stubdom support for libxenlight: - it adds two functions to find the stubdom domid of a domain and to figure out if a certain domain is actually a stubdom; - it moves all the device init functions from xl.c to libxl.c because they are needed to setup the devices of stubdoms; - it fixes some bugs in the pci setup that prevented pci passthrough from working correctly with stubdoms. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* tools: Make build again on netbsdKeir Fraser2009-11-101-4/+4
| | | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* libxenlight: initial libxenlight implementation under tools/libxlKeir Fraser2009-11-091-0/+34
Signed-off-by: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>