From: Ian Campbell Subject: Re: [PATCH V4 09/24] libxl_json: introduce parser functions for builtin types Date: Wed, 7 May 2014 10:57:02 +0100 Message-ID: <1399456622.3014.238.camel@kazak.uk.xensource.com> References: <1398949101-23320-1-git-send-email-wei.liu2@citrix.com> <1398949101-23320-10-git-send-email-wei.liu2@citrix.com> <1399381058.3014.121.camel@kazak.uk.xensource.com> <20140506130641.GF17067@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140506130641.GF17067@zion.uk.xensource.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: Wei Liu Cc: Anthony Perard , ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, 2014-05-06 at 14:06 +0100, Wei Liu wrote: > > > yajl_gen_integer to generate JSON object. > > > > > > Signed-off-by: Wei Liu > > > > Acked-by: Ian Campbell > > > > With one small question: > > > > [...] > > > diff --git a/tools/libxl/libxl_nocpuid.c b/tools/libxl/libxl_nocpuid.c > > > index 5f7cb6a..eb525fc 100644 > > > --- a/tools/libxl/libxl_nocpuid.c > > > +++ b/tools/libxl/libxl_nocpuid.c > > > @@ -44,6 +44,13 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand, > > > return 0; > > > } > > > > > > +int libxl_cpuid_policy_list_parse_json(libxl__gc *gc, > > > + const libxl__json_object *o, > > > + libxl_cpuid_policy_list *p) > > > +{ > > > + return 0; > > > > Not an error of some sort? Or even an assert? > > > > I didn't see assertion in libxl_cpuid_policy_list_gen_json either, so I > presumed it is not necessary and returning "success" is enough. Generating a "NULL" json from a NULL cpuid policy is one thing, but parsing a valid cpuid policy into NULL might be more surprising? OTOH libxl_cpuid_parse_config just returns success, and I suppose this is equivalent. OK, my ack stands. Ian.