aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/gentest.py
Commit message (Collapse)AuthorAgeFilesLines
* libxl: make devid a type so it is initialized properlyMatthew Fioravante2012-10-051-1/+1
| | | | | | | | | | | | | | | | Previously device ids in libxl were treated as integers meaning they were being initialized to 0, which is a valid device id. This patch makes devid its own type in libxl and initializes it to -1, an invalid value. This fixes a bug where if you try to do a xl DEV-attach multiple time it will continuously try to reattach device 0 instead of generating a new device id. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Reviewed-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: rename libxl_cpumap to libxl_bitmapDario Faggioli2012-07-061-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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 new Array type to the IDLIan Campbell2012-07-061-0/+12
| | | | | | | | | | | | And make all the required infrastructure updates to enable this. Since there are currently no uses of this type there is no change to the generated code. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: do not overwrite user supplied config when running bootloaderIan Campbell2012-05-291-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when running the bootloader libxl will update b_info->u.pv.kernel, .ramdisk, .cmdline and .bootloader. This can expose internal details, such as temporary paths in /var/run/xen/bootloader.*/ to the user. This is problematic because it means that the user cannot re-use the struct as is. This does not effect xl in Xen 4.2+ since it always reparses the guest config and reinitialises the build info, however it did cause issues with reboot in 4.1 (reported by Dmitry Morozhnikov) and may cause issues for other users of libxl. Instead make the libxl bootloader infrastructure provide output to its caller which is slurped into the internal libxl__domain_build_state datastructure. If no bootloader is configured then the bootloader instead propagates the user supplied b_info config. In order to simplify this push the error handling for the case where there is no bootdisk down into libxl__bootloader_run. In principal there is no reason why it shouldn't be possible to do a pure netboot guest with a suitable bootloader, but I don't fix that here. This change allow us to make the libxl_file_reference an internal API, and eventually we might be able to get rid of it. Also removes the publix libxl_run_bootloader interface, neither xl nor libvirt use it. I am proposing this for 4.2 due to the API change. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> [ ijc -- reduced log message in libxl__build_pv from INFO to DEBUG ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxl: Make IDL KeyedUnion keyvar an idl.FieldIan Campbell2012-03-011-1/+1
| | | | | | | This is more logical than having keyvar_name and keyvar_type members. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: make boolean members of libxl_domain_create_info into libxl_defboolIan Campbell2012-03-011-2/+1
| | | | | | | This allows them to be set via the _init/_setdefault methods. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: add new "defbool" built in type.Ian Campbell2012-03-011-1/+4
| | | | | | | | This type is a but like a "boolean" but with a third state "default" (so really I suppose it's a tristate). Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: introduce a descriminating default value for memkb fields.Ian Campbell2012-03-011-0/+1
| | | | | | | | | | Consitently make such fields 64 bit values as used by dominfo. It is not clear if ->video_memkb and/or shadow_memkb shouldn't be part of ->u.hvm but I have not changed that here. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: allow specification of testidl random seed.Ian Campbell2012-03-011-1/+2
| | | | | | | | Useful if you are interested in before/after results of changing the IDL or generator. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxl: drop libxl_cpuarray -- topology was the only user.Ian Campbell2012-01-311-18/+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: expose cpu topology as a single list of cpu->{node,core,socket} maps.Ian Campbell2012-01-311-0/+2
| | | | | | | | | Rather than the previous tripple list which is more complicated to work with and harder for language bindings. 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: Rename libxl IDL infrastructure.Ian Campbell2012-01-311-12/+11
| | | | | | | | | | | | | | | | Originally libxltypes.py provided the infrastructure and libxl.idl provided the specific types. In 23887:a543e10211f7 libxl.idl became libxl_types.idl (to allow for libxl_types_internal.idl) which means we now have libxl_types.FOO and libxltypes.FOO providing different things and annoying people in tab completion. Rename the infrastructure as idl. 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: idl: support new "private" type attributeIan Jackson2011-12-121-0/+2
| | | | | | | | | | | | This provides for fields in libxl datatypes which are only present in the C version of structures and are used only by libxl itself. This is useful when a libxl datatype wants to contain fields which are used by libxl internally and which are only present in the structure to avoid additional memory allocation inconvenience. 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 a flags argument to libxl_ctx_alloc.Ian Campbell2011-10-181-1/+1
| | | | | | | | | Currently unused but gives us scope for expansion in an ABI compatible manner in the future. 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: idl: use "dispose" rather than "destroy" for function to free IDL typesIan Campbell2011-10-181-2/+2
| | | | | | | | | | | Destroy is an overloaded term which would commonly like to be used for actual destructive operations, such as destroying a domain etc. Dispose isn't a great term but it does the job. 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: IDL: autogenerate functions to produce JSON from libxl data structures.Ian Campbell2011-10-071-8/+245
| | | | | | | | | | | | | | | | | | | | Two functions are provided. TYPE_gen_json exposes an interface which is compatible with the YAGL generator infrastructure. TYPE_to_string uses this to produce a pretty printed string. The TYPE_gen_json functions are defined in a new header libxl_json.h which is not exposed via libxl.h due to the use of YAGL datatypes to avoid poluting the namespace us libxl users which don't use the library themselves. If a libxl user is interested in integrating at the YAGL level then it should #include this file itself. Also update testidl to generate a random version of each IDL datastructure and convert it to JSON. Unfortunately this requires a libxl_ctx and therefore the test must be run on a Xen system 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: clean up trailing whitespaces in code.Wei Liu2011-07-191-4/+4
| | | | | | | | | 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: autogenerate to_string and from_string functions for Enumerations.Ian Campbell2011-06-211-0/+63
The generated strings are the lower case enum value names, with underscores. Accepted string for parsing are the same but are case insensitive. We provide a table of strings->value for each Enumeration as well as a convenience function to perform a lookup. 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>