aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_utils.c
Commit message (Collapse)AuthorAgeFilesLines
...
* libxl: disk specification interface changeKamala Narasimhan2011-02-151-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | 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: band-aid for functions which return literal "-1"Ian Jackson2011-01-261-4/+4
| | | | | | | | | | | | | | | Many libxl functions erroneously return "-1" on error, rather than some ERROR_* value. To deal with this, invent a new ERROR_NONSPECIFIC "-1" which indicates that "the function which generated this error code is broken". Fix up the one we care about for forthcoming duplicate domain detection (libxl_name_to_domid) and the others following the same pattern nearby; leave the rest for post-4.1. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl: Implement libxl_basename()Christoph Egger2011-01-061-0/+14
| | | | | | | | | 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 renaming of cpupoolsJuergen Gross2010-12-091-2/+2
| | | | | | | | Add a new library function libxl_cpupool_rename() and a new xl command xl cpupool-rename to support renaming of cpupools. Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
* Support getting topology info in libxlJuergen Gross2010-12-091-0/+24
| | | | | | | | 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-8/+13
| | | | | | | | | | | | | | | | | | | | 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-14/+84
| | | | | | | | | | | | | | | 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>
* tools: cpupools: Support arbitrary numbers of physical cpusJuergen Gross2010-10-211-0/+5
| | | | | | | | | | | | | | To be able to support arbitrary numbers of physical cpus it was necessary to include the size of cpumaps in the xc-interfaces for cpu pools. These were: definition of xc_cpupoolinfo_t xc_cpupool_getinfo() xc_cpupool_freeinfo() xc_cpupool_getinfo() and xc_cpupool_freeinfo() are changed to allocate the needed buffer and return it. Signed-off-by: juergen.gross@ts.fujitsu.com Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Use libxl__ namespace for internal typesIan Campbell2010-09-081-11/+11
| | | | | | | | | | | | | | It's not clear that the namespace rules described in libxl.h are intended to apply to internal types but I don't see why not. sed -i -e 's/\<libxl_device\>/libxl__device/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_device_kinds\>/libxl__device_kinds/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_gc\>/libxl__gc/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_gc_owner\>/libxl__gc_owner/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_spawn_starting\>/libxl__spawn_starting/g' tools/libxl/*.[ch] Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Ensure all _hidden functions use libxl__ prefix (manual part)Ian Campbell2010-09-081-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | This patch covers the remaining functions identified by: rgrep _hidden tools/libxl/*.h | grep -v libxl__ sed -i -e 's/XL_LOG/LIBXL__LOG/g' tools/libxl/*.[ch] sed -i -e 's/xl_log/libxl__log/g' tools/libxl/*.[ch] sed -i -e 's/\(build_\(pre\|post\|pv\|hvm\)\)/libxl__\1/g' tools/libxl/*.[ch] sed -i -e 's/is_hvm/libxl__domain_is_hvm/g' tools/libxl/*.[ch] sed -i -e 's/get_shutdown_reason/libxl__domain_shutdown_reason/g' tools/libxl/*.[ch] sed -i -e 's/restore_common/libxl__domain_restore_common/g' tools/libxl/*.[ch] sed -i -e 's/core_suspend/libxl__domain_suspend_common/g' tools/libxl/*.[ch] sed -i -e 's/save_device_model/libxl__domain_save_device_model/g' tools/libxl/*.[ch] sed -i -e 's/device_disk_backend_type_of_phystype/libxl__device_disk_backend_type_of_phystype/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_blktap_enabled\>/libxl__blktap_enabled/g' tools/libxl/*.[ch] sed -i -e 's/\<libxl_blktap_devpath\>/libxl__blktap_devpath/g' tools/libxl/*.[ch] Add _hidden to libxl__blktap_enabled and libxl__blktap_devpath Inline dominfo_libxl__domain_shutdown_reason(info) into libxl__domain_shutdown_reason, its only caller. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: Ensure all _hidden functions use libxl__ prefix (autogenerated patch)Ian Campbell2010-09-081-50/+50
| | | | | | | | | | | | | | | | | | | | | | | | This patch covers all those which could be trivially converted automatically. sed -n -e 's/_hidden.*[ \*]libxl_\([^_][^()]*\)(.*/\1/pg' tools/libxl/*.h | \ while read i ; do \ sed -i -e "s/libxl_$i/libxl__$i/g" tools/libxl/*.[ch]; \ done sed -n -e 's/_hidden.*_libxl_\([^_][^()]*\)(.*/\1/pg' tools/libxl/*.h | \ while read i ; do \ sed -i -e "s/_libxl_$i/libxl__$i/g" tools/libxl/*.[ch]; \ done Check that diffstat includes libxl but not xl. Fixup tools/libxl/xl_cmdimpl.c which used libxl_device_del instead of libxl_device_disk_del in a printf. (Patch runes re-run by Ian Jackson to refresh against tip libxl.) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl/xl: Use libxl_device_nic_destroy and libxl_nicinfo_destroyIan Campbell2010-08-191-20/+21
| | | | | | | | | Replaces libxl_free_nics_list [PATCH 14 of 16 of libxl: autogenerate type definitions and destructor functions] Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: ensure result of libxl_poolid_to_name is always dynamically allocatedIan Campbell2010-08-161-1/+1
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: Implement per-API-call garbage-collection lifetimeGianni Tedesco2010-08-121-78/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently scratch variables allocated by libxl have the same lifetime as the context. While this is suitable for one off invocations of xl. It is not so great for a daemon process linking to libxl. In that case there will be prolific leakage of heap memory. My proposed solution involves create a new libxl_gc structure, which contains a pointer to an owning context as well as the garbage collection data. Top-level library functions which expect to do a lot of scratch allocations put gc struct on the stack and initialize it with a macro. Before returning they then call libxl_free_all on this struct. This means that static helper functions called by such functions will usually take a gc instead of a ctx as a first parameter. The patch touches almost every code-path so a close review and testing would be much appreciated. I have tested with valgrind all of the parts I could which looked non-straightforward. Suffice to say that it seems crash-free even if we have exposed a few real memory leaks. These are for cases where we return eg. block list to an xl caller but there is no appropriate block_list_free() function to call. Ian Campbells work in this area should sew up all these loose ends. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: Fix invalid return of internal ptrs via libxl_poolid_to_name"Gianni Tedesco (3P)"2010-08-111-2/+9
| | | | | | | | | 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. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: Fix invalid return of libxl-internal pointers via libxl_domid_to_name()"Gianni Tedesco (3P)"2010-08-111-2/+9
| | | | | | | | | | 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. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* xl: don't use libxl allocator for nic_list"Gianni Tedesco (3P)"2010-08-111-6/+9
| | | | | | | | | 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. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl_check_device_model_version should return 0 or 1Stefano Stabellini2010-08-091-1/+1
| | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl, Introduce the command line handler for the new qemu.Anthony Perard2010-08-091-0/+78
| | | | | | | | | | | | | | | | 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: fix memory leak in libxl_name_to_poolidJuergen Gross2010-08-051-2/+5
| | | | | Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxl: fix memory leak in libxl_name_to_domidIan Campbell2010-08-031-2/+5
| | | | | | | | | | | | | | | | 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>
* libxl: consistently use typedef struct {} libxl_$typeIan Campbell2010-07-281-20/+20
| | | | | | | | 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>
* libxl: fix segfault when detaching non-existant diskGianni Tedesco2010-07-271-0/+2
| | | | | Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: network2-detach commandKeir Fraser2010-06-071-0/+48
| | | | | | Usage: xl network2-detach <Domain> <DevId> Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
* xl: network2-attach commandKeir Fraser2010-06-071-0/+15
| | | | | | | | | | 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: Check return codes of write/asprintf/daemon consistently.Keir Fraser2010-05-131-0/+2
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xl: Implement block-detach commandKeir Fraser2010-05-131-0/+35
| | | | Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
* xl: Implement network-detach commandKeir Fraser2010-05-131-0/+74
| | | | Signed-off-by: Eric Chanudet <eric.chanudet@citrix.com>
* libxl: More cpupool fixes.Keir Fraser2010-05-111-0/+2
| | | | Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* libxl: Support cpupoolsKeir Fraser2010-05-071-0/+35
| | | | Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* xl: Remove some duplicated boilerplate. (Improves logging slightly.)Keir Fraser2010-04-121-1/+2
| | | | | | | | | | | | | | | | | 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>
* xenstore,libxl: cleanup of xenstore connections across fork()Keir Fraser2010-04-121-0/+15
| | | | | | | | | | | | | | | Provide a new function xs_daemon_destroy_postfork which can be called by a libxenstore user who has called fork, to close the fd for the connection to xenstored and free the memory, without trying to do anything to any threads which libxenstore may have created. Use this new function in libxl_fork, to avoid accidental use of a xenstore connection in both parent and child. Also, fix the doc comment for libxl_spawn_spawn to have the success return codes the right way round. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Expose functions for helping with subprocesses.Keir Fraser2010-04-121-0/+23
| | | | | | | | | | | | | | | | | | | | * 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/+103
| | | | | | | | | | | | | | | | | | | | | 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>
* libxl: Report error if logfile rotation failsKeir Fraser2010-04-121-3/+25
| | | | | | | | Check the return values from renames and errors from stat in libxl_create_logfile (which, misleadingly, does not actually create the logfile). Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxenlight: separate logically list_vm and list_domainKeir Fraser2010-01-171-6/+13
| | | | | | | | | | | 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: fix name to domid conversion.Keir Fraser2010-01-141-23/+12
| | | | | | | also simplify massively the function that iterate over all domains to find the corresponding domid to a name. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
* libxenlight: remove any uuid dependancies from xlKeir Fraser2010-01-051-85/+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/+30
| | | | | | | | | | | 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: write stubdoms logs to fileKeir Fraser2009-12-021-1/+1
| | | | | | | | | | It turns out that there is a better way to write stubdoms logs to file than using libxl_console_attach: qemu is the one that provides the console backend for stubdoms and qemu is able to redirect a serial to file, so we can use this feature to make sure the first stubdom console is always redirected to a logfile. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxenlight: two small fixesKeir Fraser2009-12-021-1/+1
| | | | | | | | | | | - set the domid of the guest and not the one of the stubdom in the libxl_device_model_starting returned to the user; - check that the length of the two strings matches in libxl_name_to_domid, otherwise we can get a match for two different domains that have the same initial part of the name. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxenlight: fix uuid codeKeir Fraser2009-12-011-6/+6
| | | | | | | | - Use proper constants - Use functions from the uuid library - Fix broken pointer handling in libxl_dominfo Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.com>
* libxenlight: move logging macros to the public headerKeir Fraser2009-11-251-0/+27
| | | | | | | | | | 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/+19
| | | | | | | | | | | | | | | 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>
* libxenlight: fix memory leaksKeir Fraser2009-11-231-0/+6
| | | | | | | | | | | | | | | | In particular: - all the temporary flexarrays allocated in the create device functions must be freed; - all the strings that don't need to be modified can be added as they are to these temporary flexarrays instead of duplicating them; - any data returned to the user shouldn't be added to the global memory tracker so that the user can free it whenever he wishes. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* libxenlight: correct broken osdeps.[ch] and make #includes consistentKeir Fraser2009-11-231-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osdeps.[hc] previously mistakenly declared and defined [v]asprintf. These functions are available in the libc on most platforms. Also, osdeps.h is used by xc.c but xc.c is not part of the library, so osdeps.h is part of the public interface and should have a better name. So now, instead: * osdeps.h is libxl_osdeps.h. * _GNU_SOURCE is #defined in libxl_osdeps.h so that we get the system [v]asprintf (and various other functions) * libxl_osdeps.h is included first in every libxl*.c file (it needs to be before any system headers so that _GNU_SOURCE) takes effect. * osdeps.[hc] only provide their own reimplementation of [v]asprintf if NEED_OWN_ASPRINTF is defined. Currently it is not ever defined but this is provided for any platform which needs it. * While I was editing the #includes in each .c file, I put them all into the same order: "libxl_osdeps.h", then system headers, then local headers. * xs.h is included in libxl.h. This is needed for "bool"; it has to not be typedefed in libxl.h because otherwise we get a duplicate definition when including xs.h. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxenlight: fix name to domid conversionKeir Fraser2009-11-131-5/+13
| | | | | | | | This patch makes sure that the domain name to domid conversion is correct, cross referencing the information found on xenstore with the list of running domains. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* tools: Make build again on netbsdKeir Fraser2009-11-101-21/+16
| | | | | 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/+159
Signed-off-by: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>