On 11/23/2017 07:23 AM, Pino Toscano wrote:
While YAJL mostly works fine, it did not see any active development
in
the latest 3 years. OTOH, Jansson is another JSON C implementation,
with a very liberal license, and a much nicer API.
Hence, switch all of libguestfs from YAJL to Jansson:
- configure checks, and buildsystem in general
- packages pulled in the appliance
- actual implementations
- contrib scripts
- documentation
This also makes use of the better APIs available (e.g. json_object_get,
json_array_foreach, and json_object_foreach). This does not change the
API of our OCaml Yajl module.
The only behaviour change is that Jansson by default accepts only
objects and arrays as input (even though it has a flag to make it accept
anything). Since this seems a good idea anyway, and as it is the RFC
behaviour, then change one of the yajl_tests checks accordingly.
Which RFC?
RFC 4627 stated that only objects or arrays could occur at the top
level. But it was superseded by:
RFC 7159, which states that ANY json value can be the top level of the
grammar.
So maybe it's better to set the flags and always allow all objects.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization:
qemu.org |
libvirt.org