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

Daniel P. Berrangé berrange at redhat.com
Tue May 15 16:24:40 UTC 2018


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 :-(

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