libxl: idl: generate KeyedUnion key member as part of the KeyedUnion
authorIan Campbell <ian.campbell@citrix.com>
Thu, 1 Mar 2012 12:26:15 +0000 (12:26 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 1 Mar 2012 12:26:15 +0000 (12:26 +0000)
Rather than specifying it twice in the IDL.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/gentypes.py
tools/libxl/libxl_types.idl

index 4a2d0cecca14e69e656c15a20ddee91a764a175d..a70c8d0f6577b3bfff2625c175270b007652fb5f 100644 (file)
@@ -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:
index d93f40143cea0eedfa913e6c67eeb870ee9727ab..54278359352fac9abd55ebae19c789812849fc72 100644 (file)
@@ -237,7 +237,6 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("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),
@@ -447,7 +446,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),