]> xenbits.xensource.com Git - xen.git/commitdiff
libxl/gentypes.py: don't generate JSON for private type(s)
authorWei Liu <wei.liu2@citrix.com>
Thu, 10 Apr 2014 15:26:31 +0000 (16:26 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 16 Apr 2014 16:06:36 +0000 (17:06 +0100)
Private types are only useful inside libxl. They don't have a valid JSON
generation function by default.

Currently there's only one private type, that's libxl_ev_link. Not
skipping this field causes testidl to fail as the code generated for
this type is NULL.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/gentypes.py

index be06257d0d42ead03bdeb333be544b8f9021f2eb..1a3b91cf6891fe5962dbb24718bd178bf874565a 100644 (file)
@@ -226,7 +226,7 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
         s += "s = yajl_gen_map_open(hand);\n"
         s += "if (s != yajl_gen_status_ok)\n"
         s += "    goto out;\n"
-        for f in [f for f in ty.fields if not f.const]:
+        for f in [f for f in ty.fields if not f.const and not f.type.private]:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (f.name, f.name)
             s += "if (s != yajl_gen_status_ok)\n"