From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtEzM-00083K-EV for qemu-devel@nongnu.org; Mon, 02 Nov 2015 08:17:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtEzJ-0000wH-9P for qemu-devel@nongnu.org; Mon, 02 Nov 2015 08:17:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtEzJ-0000wD-3b for qemu-devel@nongnu.org; Mon, 02 Nov 2015 08:17:29 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id D6CEB8C1AA for ; Mon, 2 Nov 2015 13:17:27 +0000 (UTC) Date: Mon, 2 Nov 2015 08:17:26 -0500 From: Luiz Capitulino Message-ID: <20151102081726.76b9ebd9@redhat.com> In-Reply-To: <5633C8EC.8030309@redhat.com> References: <5633C8EC.8030309@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] RFC: libyajl for JSON List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: "qemu-devel@nongnu.org" , "Dr. David Alan Gilbert" , Markus Armbruster [I thought I had replied to this thread, but it doesn't seem so. So, I'll try again] On Fri, 30 Oct 2015 13:45:48 -0600 Eric Blake wrote: > Loaded question in response to > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06988.html, but > posting as a new thread to call attention to it: > > Libvirt uses libyajl to parse and format JSON. Would it be worth > dragging in yet another prerequisite library into qemu and reuse > libyajl's parser instead of our own hand-rolled one? I'd be in favor of that. I don't exactly remember why we didn't use an external library like libyajl. Maybe it was unknown to us, or maybe having an external dep was too painful at the time. But I do remember we looked at having something we could merge in QEMU source code, and everything we found had license issues. > > I know that a while ago, the answer was "as long as we support > out-of-the-box builds on RHEL 5, that platform lacks yajl therefore we > can't depend on it" (and libvirt's solution on RHEL 5 is "qemu doesn't > support QMP and thus doesn't use JSON and thus libvirt doesn't need yajl > there"). > > But now that we have just recently bumped the minimum glib and python > versions to something not available on RHEL 5, it may also be time to > start thinking about outsourcing to libyajl, because as far as I can > tell, every platform that currently supports qemu out of the box has a > version of libyajl. And since libvirt has already figured out the grunt > work of how to simultaneously code to both the 1.x and 2.x APIs, it's > not that much of a stretch to reuse that work in qemu. > > On the other hand, one of the "features" of qemu's hand-rolled json > parser is the ability to do qobject_from_jsonf("{'foo':%s}", "bar") > (that is, we extended JSON with our notion of single-quoted strings, and > with our notion of %s and similar escape sequences for piecing together > multiple inputs into a single input stream without having to first > g_strdup_printf our pieces into a single string). I don't know if > libyajl lets us add extensions to the language it parses. >