[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 25 of 26 V3] libxl: idl: generate KeyedUnion key member as part of the KeyedUnion



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1330000278 0
# Node ID 6dedf527d9b77f5ed3ca583683c00afd88c7bb6f
# Parent  7c9766bee67645daf47b08b578639025f3427c24
libxl: idl: generate KeyedUnion key member as part of the KeyedUnion

Rather than specifying it twice in the IDL.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 7c9766bee676 -r 6dedf527d9b7 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py   Thu Feb 23 12:31:18 2012 +0000
+++ b/tools/libxl/gentypes.py   Thu Feb 23 12:31:18 2012 +0000
@@ -32,6 +32,9 @@ def libxl_C_type_define(ty, indent = "")
             s += "} %s" % ty.typename
 
     elif isinstance(ty, idl.Aggregate):
+        if isinstance(ty, idl.KeyedUnion):
+            s += libxl_C_instance_of(ty.keyvar.type, ty.keyvar.name) + ";\n"
+            
         if ty.typename is None:
             s += "%s {\n" % ty.kind
         else:
diff -r 7c9766bee676 -r 6dedf527d9b7 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Thu Feb 23 12:31:18 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Thu Feb 23 12:31:18 2012 +0000
@@ -231,7 +231,6 @@ libxl_domain_build_info = Struct("domain
     ("shadow_memkb",    MemKB),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
-    ("type",            libxl_domain_type),
     
     ("device_model_version", libxl_device_model_version),
     ("device_model_stubdomain", libxl_defbool),
@@ -440,7 +439,6 @@ libxl_event = Struct("event",[
     ("domid",    libxl_domid),
     ("domuuid",  libxl_uuid),
     ("for_user", libxl_ev_user),
-    ("type",     libxl_event_type),
     ("u", KeyedUnion(None, libxl_event_type, "type",
           [("domain_shutdown", Struct(None, [
                                              ("shutdown_reason", uint8),

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.