From patchwork Mon Apr 14 16:53:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 28365 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6DD132036A for ; Mon, 14 Apr 2014 16:55:15 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lh14sf28949281vcb.2 for ; Mon, 14 Apr 2014 09:55:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:from:to:date:in-reply-to :references:organization:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=eovGnMc2R+Mif+D8/gz4v6ZCpUiv77ucyQah7QsSmyw=; b=LhSYW0fSvSCzQIWw97VIZ6W0WBcFnolQK3z4Q2UtpFK8HiMMkdivxvBG81CasTbQaI 1I/IYvPTD2+uBIid0CVyPth0tjZL8/Br0fyPM1zwwW2P6E7HjbagzZui1BfDJSJIr2JJ us/0V0xWKVgCvJcoIDnA6tZzHx5lCgdW8llNYOHgcVArZXs3bQtuHttEA9TP9I3EThCC ve8I1X2Em/uLJPd7VUz8szOPSs9DBQzk8cgnM4oBnYjK+YIXvKF0I8tPRfP1duYhC6OC QWZHdICzptSBNxolSGHnOa80BI8rBxciebjFKoms9mCctSNDVlPF9OeWl1Nh/fykQWaV KktQ== X-Gm-Message-State: ALoCoQlm7jYnfrB9OQnC08QzAe6jqcHEF6Z0MPoHWGUwxk/ugCsx06uPkjPunXKP4AsjVeZoT69t X-Received: by 10.52.163.82 with SMTP id yg18mr17798738vdb.3.1397494515191; Mon, 14 Apr 2014 09:55:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.40 with SMTP id 37ls2796557qgk.32.gmail; Mon, 14 Apr 2014 09:55:15 -0700 (PDT) X-Received: by 10.58.38.166 with SMTP id h6mr3816481vek.22.1397494514960; Mon, 14 Apr 2014 09:55:14 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id sh5si2844590vdc.176.2014.04.14.09.55.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:55:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so7951637veb.11 for ; Mon, 14 Apr 2014 09:55:14 -0700 (PDT) X-Received: by 10.220.188.10 with SMTP id cy10mr838576vcb.36.1397494514803; Mon, 14 Apr 2014 09:55:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp164944vcb; Mon, 14 Apr 2014 09:55:14 -0700 (PDT) X-Received: by 10.50.67.3 with SMTP id j3mr17169622igt.10.1397494513794; Mon, 14 Apr 2014 09:55:13 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id b9si12916716igx.21.2014.04.14.09.55.13 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:55:13 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WZk8D-0002VF-Rk; Mon, 14 Apr 2014 16:53:17 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WZk8C-0002V0-FJ for xen-devel@lists.xen.org; Mon, 14 Apr 2014 16:53:16 +0000 Received: from [85.158.143.35:19689] by server-3.bemta-4.messagelabs.com id 04/C3-13602-B721C435; Mon, 14 Apr 2014 16:53:15 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-4.tower-21.messagelabs.com!1397494393!9046923!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10796 invoked from network); 14 Apr 2014 16:53:15 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 14 Apr 2014 16:53:15 -0000 X-IronPort-AV: E=Sophos;i="4.97,858,1389744000"; d="scan'208";a="120925293" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 14 Apr 2014 16:53:14 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.123.3; Mon, 14 Apr 2014 12:53:13 -0400 Received: from gateway-cbg.eng.citrite.net ([10.80.16.17] helo=[127.0.0.1]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WZk88-0007zS-H2; Mon, 14 Apr 2014 17:53:12 +0100 Message-ID: <1397494391.7802.20.camel@dagon.hellion.org.uk> From: Ian Campbell To: Wei Liu Date: Mon, 14 Apr 2014 17:53:11 +0100 In-Reply-To: <1397143594-15308-4-git-send-email-wei.liu2@citrix.com> References: <1397143594-15308-1-git-send-email-wei.liu2@citrix.com> <1397143594-15308-4-git-send-email-wei.liu2@citrix.com> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.8.5-2+b3 MIME-Version: 1.0 X-DLP: MIA2 Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org Subject: Re: [Xen-devel] [PATCH V2 3/4] libxl/gentypes.py: generate empty map for None field in keyed-union X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: On Thu, 2014-04-10 at 16:26 +0100, Wei Liu wrote: > Without this the generated JSON is malformed. > > Signed-off-by: Wei Liu Hold on the Ack... > + else: > + s += " yajl_gen_map_open(hand);\n" ITHM s =... > + s += " if (s != yajl_gen_status_ok)\n" > + s += " goto out;\n" > + s += " yajl_gen_map_close(hand);\n" and again. Spotted because the diff of the generated code across the entire series was as below, the spurious change is pretty obvious in the third hunk. Ian. --- tools/libxl/_libxl_BACKUP_types.c 2014-04-14 17:51:03.000000000 +0100 +++ tools/libxl/_libxl_types.c 2014-04-14 17:51:11.000000000 +0100 @@ -2523,6 +2523,12 @@ yajl_gen_status libxl_domain_build_info_ goto out; break; case LIBXL_DOMAIN_TYPE_INVALID: + yajl_gen_map_open(hand); + if (s != yajl_gen_status_ok) + goto out; + yajl_gen_map_close(hand); + if (s != yajl_gen_status_ok) + goto out; break; } s = yajl_gen_map_close(hand); @@ -3631,9 +3637,6 @@ yajl_gen_status libxl_event_gen_json(yaj s = yajl_gen_map_open(hand); if (s != yajl_gen_status_ok) goto out; - s = yajl_gen_string(hand, (const unsigned char *)"link", sizeof("link")-1); - if (s != yajl_gen_status_ok) - goto out; s = yajl_gen_string(hand, (const unsigned char *)"domid", sizeof("domid")-1); if (s != yajl_gen_status_ok) goto out; @@ -3713,10 +3716,10 @@ yajl_gen_status libxl_event_gen_json(yaj goto out; break; case LIBXL_EVENT_TYPE_DOMAIN_CREATE_CONSOLE_AVAILABLE: - s = yajl_gen_map_open(hand); + yajl_gen_map_open(hand); if (s != yajl_gen_status_ok) goto out; - s = yajl_gen_map_close(hand); + yajl_gen_map_close(hand); if (s != yajl_gen_status_ok) goto out; break; --- tools/libxl/_libxl_BACKUP_types.h 2014-04-14 17:51:03.000000000 +0100 +++ tools/libxl/_libxl_types.h 2014-04-14 17:51:11.000000000 +0100 @@ -694,8 +694,6 @@ typedef struct libxl_event { struct { int rc; } operation_complete; - struct { - } domain_create_console_available; } u; } libxl_event; void libxl_event_dispose(libxl_event *p);