From: Wei Liu Subject: Re: [PATCH V4 09/24] libxl_json: introduce parser functions for builtin types Date: Tue, 13 May 2014 12:38:08 +0100 Message-ID: <20140513113808.GK6332@zion.uk.xensource.com> References: <20140512164313.GF6332@zion.uk.xensource.com> <1399969566.11314.20.camel@kazak.uk.xensource.com> <20140513091954.GG6332@zion.uk.xensource.com> <1399973577.11314.35.camel@kazak.uk.xensource.com> <20140513104004.GH6332@zion.uk.xensource.com> <1399977904.21867.2.camel@kazak.uk.xensource.com> <20140513105140.GI6332@zion.uk.xensource.com> <1399978530.21867.4.camel@kazak.uk.xensource.com> <20140513110359.GJ6332@zion.uk.xensource.com> <1399979609.21867.10.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1399979609.21867.10.camel@kazak.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: Ian Campbell Cc: Anthony PERARD , ian.jackson@eu.citrix.com, Wei Liu , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, May 13, 2014 at 12:13:29PM +0100, Ian Campbell wrote: > On Tue, 2014-05-13 at 12:03 +0100, Wei Liu wrote: > > On Tue, May 13, 2014 at 11:55:30AM +0100, Ian Campbell wrote: > > [...] > > > > And presumably if we are to make this change we also need to update > > > > libxl.h to have LIBXL_JSON_GENERATE_NUMBER-ish? What would you suggest > > > > for the name? > > > > > > Does this actually change the output syntax at all? If it is just a bug > > > fix then we don't need to announce it I think. Any consumers of the JSON > > > will have to cope with the buggy version (if they want to) irrespective > > > of any #define. > > > > > > > I will need to check. Presumably it generates a string or something. > > Isn't JSON duck typed though? IOW a correct parser should treat {foo: 1} > and {foo: "1"} the same, if the field foo has numerical semantics? > My initial test shows that for -1 it generates { foo : 18446744073709551615 } which is actually still a number. So we can safely assume that this is a bugfix. No #define in libxl.h needed. > What does libyajl's parser do? > It doesn't seem to be very well documented. Wei. > > We can treat it as a bug fix if we only use yajl_gen_number of uint64_t, > > other uint types are not affect. > > > > Wei. >