From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH V2 1/4] libxl/gentypes.py: don't generate JSON for private type(s) Date: Thu, 10 Apr 2014 16:26:31 +0100 Message-ID: <1397143594-15308-2-git-send-email-wei.liu2@citrix.com> References: <1397143594-15308-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1397143594-15308-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Wei Liu , ian.jackson@eu.citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org 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 --- tools/libxl/gentypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py index be06257..1a3b91c 100644 --- a/tools/libxl/gentypes.py +++ b/tools/libxl/gentypes.py @@ -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" -- 1.7.10.4