[libvirt] [PATCH 8/9] virjson: add support for Jansson

Peter Krempa pkrempa at redhat.com
Sat Mar 31 09:19:03 UTC 2018


On Sat, Mar 31, 2018 at 11:13:13 +0200, Peter Krempa wrote:
> On Thu, Mar 29, 2018 at 01:09:57 +0200, Ján Tomko wrote:
> > Check for the presence of Jansson library and prefer it to yajl
> > if possible.
> > 
> > The minimum required version is 2.7.
> > 
> > Internally, virJSONValue still stores numbers as strings even
> > though Jansson uses numeric variables for them.
> > 
> > The configure script is particularly hideous, but will hopefully
> > go away after we stop aiming to support compiling on CentOS 6.
> > 
> > Signed-off-by: Ján Tomko <jtomko at redhat.com>
> > ---
> >  configure.ac       |   1 +
> >  m4/virt-json.m4    |  55 +++++++++++---
> >  src/util/virjson.c | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 264 insertions(+), 11 deletions(-)

[...]

> > +
> > +    case JSON_INTEGER:
> > +        ret = virJSONValueNewNumberLong(json_integer_value(json));
> > +        break;
> > +
> > +    case JSON_REAL:
> > +        ret = virJSONValueNewNumberDouble(json_real_value(json));
> > +        break;
> 
> After mi privatization of struct _virJSONValue it should be simple
> enough to add the same differetiation to our code.

As a side-note, the qemu QAPI schema differentiates these as well, thus
this change would make our schema validator more strict. Also it would
possibly have some test fallout
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180331/8af7940b/attachment-0001.sig>


More information about the libvir-list mailing list