Received: from eggs.gnu.org ([2001:4830:134:3::10]:54807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8vbH-0001qj-RJ for qemu-devel@nongnu.org; Mon, 21 Nov 2016 15:54:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8vbE-0000T0-Q0 for qemu-devel@nongnu.org; Mon, 21 Nov 2016 15:54:03 -0500 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]:36479) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c8vbE-0000Sh-Kf for qemu-devel@nongnu.org; Mon, 21 Nov 2016 15:54:00 -0500 Received: by mail-it0-x241.google.com with SMTP id n68so286192itn.3 for ; Mon, 21 Nov 2016 12:54:00 -0800 (PST) In-Reply-To: <3c5fdd4e-da35-46d9-9c64-a1a269f41646@redhat.com> References: <673F175E-AF65-4F4F-9895-C7335A36AC29@gmail.com> <8b136de6-490a-d194-b7a6-eabfb87daf2c@redhat.com> <16AF327F-E1FE-4F2E-9919-A474276474FF@gmail.com> <182f25fb-98bd-73db-62f3-ff18b30a49cd@redhat.com> <3c5fdd4e-da35-46d9-9c64-a1a269f41646@redhat.com> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <62F97615-8739-43D4-B09C-1C34091C54D7@gmail.com> Content-Transfer-Encoding: 7bit From: G 3 Date: Mon, 21 Nov 2016 15:53:53 -0500 Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Paolo Bonzini , Markus Armbruster , qemu-devel qemu-devel On Nov 21, 2016, at 3:46 PM, Eric Blake wrote: > 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. Sounds like a good idea.