[libvirt] [PATCHv3 00/13] Switch from yajl to Jansson

Daniel P. Berrangé berrange at redhat.com
Wed May 16 09:09:31 UTC 2018


On Wed, May 16, 2018 at 10:53:22AM +0200, Ján Tomko wrote:
> On Tue, May 15, 2018 at 05:24:40PM +0100, Daniel P. Berrangé wrote:
> > On Tue, May 15, 2018 at 06:12:05PM +0200, Andrea Bolognani wrote:
> > > On Fri, 2018-05-11 at 14:59 +0200, Ján Tomko wrote:
> > > > Per the discussion here:
> > > > https://www.redhat.com/archives/libvir-list/2017-November/msg00225.html
> > > > Switch from using yajl to Jansson.
> > > 
> > > I tried building
> > > 
> > >   https://repo.or.cz/libvirt/jtomko.git/ jansson
> > > 
> > > on all platform libvirt supports.
> > > 
> > > Debian 8, Ubuntu 14.04 and Ubuntu 16.04 all linked successfully
> > > against Jansson, but when running the test suite I got
> > > 
> > >   FAIL: virnetdaemontest
> > >   FAIL: qemumonitorjsontest
> > >   FAIL: qemucapabilitiestest
> > >   FAIL: qemuhotplugtest
> > >   FAIL: qemucommandutiltest
> > >   FAIL: qemublocktest
> > >   FAIL: qemumigparamstest
> > >   FAIL: virjsontest
> > > 
> > > >From a quick look, it seems like at least some of the failures
> > > are caused by dictionaries and arrays having their members
> > > shuffled around.
> > 
> > When using YAJL, object properties are stored in arrays, so order is
> > stable when printing.
> > 
> > With Jansson, object properties appear to be stored in hash tables,
> > so order is potentially unstable when printing.
> > 
> > I'm a little surprised it doesn't fail on all platforms - makes me
> > wonder how good the hash function is.
> > 
> > Looks like we would need JSON_SORT_KEYS to json_dumps(), but that
> > may well require all test data to be recreated :-(
> > 
> 
> There is a JSON_PRESERVE_ORDER flag since v1.3 that formats the keys
> in the same order they were added and it's the default since 2.8.

Ah excellant - that'll explain why only some distros failed - presumably
they have version < 2.8

> I have pushed a patch that uses it on my repo:
> https://repo.or.cz/libvirt/jtomko.git/ jansson_preserve


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list