[libvirt] [PATCH] util: json: Remove yajl bits from virJSONValueToStr

Peter Krempa pkrempa at redhat.com
Tue Apr 3 11:33:11 UTC 2018


On Tue, Apr 03, 2018 at 12:23:13 +0100, Daniel Berrange wrote:
> On Sat, Mar 31, 2018 at 11:01:15AM +0200, Peter Krempa wrote:
> > Rather than depending on yajl bits for creating the JSON structure
> > replace it by few virBuffer bits. This will make the JSON formatter
> > libary agnostic.
> 
> I don't think this is a good idea as it means we have to reinvent the
> wheel to ensure that we are correctly formatting & escaping JSON. This
> patch gets escaping wrong which illustrates the point :-(
> 
> It has also discarded the utf8 validation that the old code did.

Fair enough. I honestly only cared about the values which we
encountered.

What triggered me to send this patch was, that the proposal to add
another library added yet another place where virJSONValues were
converted to some internal type back and forth, which seems utterly
inefficient.
-------------- 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/20180403/b2913428/attachment-0001.sig>


More information about the libvir-list mailing list