xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH V2 3/4] libxl/gentypes.py: generate empty map for None field in keyed-union
Date: Mon, 14 Apr 2014 17:53:11 +0100	[thread overview]
Message-ID: <1397494391.7802.20.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <1397143594-15308-4-git-send-email-wei.liu2@citrix.com>

On Thu, 2014-04-10 at 16:26 +0100, Wei Liu wrote:
> Without this the generated JSON is malformed.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>

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);

  parent reply	other threads:[~2014-04-14 16:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 15:26 [PATCH V2 0/4] libxl: fixes for JSON infrastructure Wei Liu
2014-04-10 15:26 ` [PATCH V2 1/4] libxl/gentypes.py: don't generate JSON for private type(s) Wei Liu
2014-04-14 16:46   ` Ian Campbell
2014-04-10 15:26 ` [PATCH V2 2/4] libxl_json: fix JSON parser debug code Wei Liu
2014-04-14 16:47   ` Ian Campbell
2014-04-10 15:26 ` [PATCH V2 3/4] libxl/gentypes.py: generate empty map for None field in keyed-union Wei Liu
2014-04-14 16:47   ` Ian Campbell
2014-04-14 16:53   ` Ian Campbell [this message]
2014-04-14 16:59     ` Wei Liu
2014-04-14 17:08       ` Ian Campbell
2014-04-14 17:11         ` Wei Liu
2014-04-16 16:30           ` Ian Campbell
2014-04-16 16:36             ` Wei Liu
2014-04-15 10:29         ` Ian Jackson
2014-04-15 10:32           ` Ian Campbell
2014-04-15 11:29             ` Ian Jackson
2014-04-10 15:26 ` [PATCH V2 4/4] libxl_types.idl: replace empty Struct with None for libxl_event Wei Liu
2014-04-14 16:49   ` Ian Campbell
2014-04-14 16:54     ` Wei Liu
2014-04-14 17:09       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1397494391.7802.20.camel@dagon.hellion.org.uk \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).