qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'


From: Eric Blake
Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'
Date: Mon, 21 Nov 2016 14:46:22 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/21/2016 02:36 PM, Eric Blake wrote:
> but I'd argue that using qobject_from_jsonf() is already less-than-useful.

In fact, we are down to only a handful of users of our modified 'jsonf'
format (that is, strings that mix JSON with % modifiers):

hw/pci/pcie_aer.c: build a 5-element QDict
monitor.c: build a 1-element QDict which contains a 2-element QDict
qapi/qmp-dispatch.c: build a 2-element QDict
qapi/qmp-event.c: Build a 2-element QDict

plus the testsuite (check-qjson.c).

>   It's hard to argue that the
> complexity of maintaining our pseudo-printf JSON parser for constructing
> a QObject with one line is worth the effort compared to the three or
> four lines to construct the same QObject by hand.

I'm severely tempted to just rip out all of the poorly-underdocumented %
parsing from the JSON parser, as it will simplify our code, without much
pain in converting the four real users to just manually build up the
same objects.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]