From: Ian Campbell Date: Wed, 20 Apr 2011 16:13:07 +0000 (+0100) Subject: tools: libxl: reduce number of integer types in the IDL X-Git-Tag: 4.2.0-rc1~2306 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9740fd134867687f5955bf09daf30d498962b221;p=xen.git tools: libxl: reduce number of integer types in the IDL Remove unsigned_interger, unsigned and unsigned_long in favour of the uintX types. Retain the integer type as a 24 bit signed integer. This will benefit language bindings for higher-level languages which don't support the full machine int size. Signed-off-by: Ian Campbell Acked-by: Ian Jackson Committed-by: Ian Jackson --- diff --git a/tools/libxl/idl.txt b/tools/libxl/idl.txt index a1a3125cc4..dad59ac50c 100644 --- a/tools/libxl/idl.txt +++ b/tools/libxl/idl.txt @@ -143,10 +143,7 @@ Several standard types a predefined. They are void (void pointer type) bool size_t -integer (C int type) -unsigned_integer (C unsigned int type) -unsigned (C unsigned int type) -unsigned_long (C unsigned long type) +integer 24 bit signed integer. uint{8,16,32,64} uint{8,16,32,64}_t diff --git a/tools/libxl/libxl.idl b/tools/libxl/libxl.idl index 17525a97ec..a5be66ff42 100644 --- a/tools/libxl/libxl.idl +++ b/tools/libxl/libxl.idl @@ -95,7 +95,7 @@ libxl_dominfo = Struct("dominfo",[ ("shutdown", bool), ("dying", bool), - ("shutdown_reason", unsigned, False, + ("shutdown_reason", uint8, False, """Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying). Otherwise set to a value guaranteed not to clash with any valid @@ -129,8 +129,8 @@ libxl_version_info = Struct("version_info", [ ("compile_date", string), ("capabilities", string), ("changeset", string), - ("virt_start", unsigned_long), - ("pagesize", unsigned_long), + ("virt_start", uint64), + ("pagesize", integer), ("commandline", string), ]) @@ -157,7 +157,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("shadow_memkb", uint32), ("disable_migrate", bool), ("cpuid", libxl_cpuid_policy_list), - ("hvm", integer), + ("hvm", bool), ("u", KeyedUnion(None, "hvm", [("hvm", "%s", Struct(None, [("hvmloader", string), @@ -220,7 +220,7 @@ libxl_device_model_info = Struct("device_model_info",[ ("apic", bool, False, "apic enabled or disabled"), ("vcpus", integer, False, "max number of vcpus"), ("vcpu_avail", integer, False, "vcpus actually available"), - ("xen_platform_pci", integer, False, "enable/disable the xen platform pci device"), + ("xen_platform_pci", bool, False, "enable/disable the xen platform pci device"), ("extra", libxl_string_list, False, "extra parameters pass directly to qemu, NULL terminated"), ], comment= @@ -283,9 +283,9 @@ libxl_device_pci = Struct("device_pci", [ ("func", uint8), ("dev", uint8), ("bus", uint8), - ("domain", unsigned_integer), - ("vdevfn", unsigned_integer), - ("vfunc_mask", unsigned_integer), + ("domain", integer), + ("vdevfn", uint32), + ("vfunc_mask", uint32), ("msitranslate", bool), ("power_mgmt", bool), ]) diff --git a/tools/libxl/libxltypes.py b/tools/libxl/libxltypes.py index 0c85d79879..87605d81fd 100644 --- a/tools/libxl/libxltypes.py +++ b/tools/libxl/libxltypes.py @@ -162,9 +162,6 @@ bool = Builtin("bool", namespace = None) size_t = Number("size_t", namespace = None) integer = Number("int", namespace = None, signed = True) -unsigned_integer = Number("unsigned int", namespace = None) -unsigned = Number("unsigned int", namespace = None) -unsigned_long = Number("unsigned long", namespace = None) uint8 = UInt(8) uint16 = UInt(16) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 48d89f97e3..15e21f2d51 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -3699,8 +3699,8 @@ static void output_xeninfo(void) printf("xen_extra : %s\n", info->xen_version_extra); printf("xen_caps : %s\n", info->capabilities); printf("xen_scheduler : %s\n", libxl_schedid_to_name(ctx, sched_id)); - printf("xen_pagesize : %lu\n", info->pagesize); - printf("platform_params : virt_start=0x%lx\n", info->virt_start); + printf("xen_pagesize : %u\n", info->pagesize); + printf("platform_params : virt_start=0x%"PRIx64"\n", info->virt_start); printf("xen_changeset : %s\n", info->changeset); printf("xen_commandline : %s\n", info->commandline); printf("cc_compiler : %s\n", info->compiler);