From: Eric Blake <eblake@redhat.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: [Qemu-devel] RFC: libyajl for JSON
Date: Fri, 30 Oct 2015 13:45:48 -0600 [thread overview]
Message-ID: <5633C8EC.8030309@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
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 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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next reply other threads:[~2015-10-30 19:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 19:45 Eric Blake [this message]
2015-10-30 20:16 ` [Qemu-devel] RFC: libyajl for JSON Peter Maydell
2015-11-02 8:40 ` Markus Armbruster
2015-11-02 11:49 ` Paolo Bonzini
2015-11-02 12:56 ` Markus Armbruster
2015-11-02 13:47 ` Paolo Bonzini
2015-11-02 14:10 ` Stefan Hajnoczi
2015-11-02 15:46 ` Eric Blake
2015-11-02 19:10 ` Markus Armbruster
2015-11-02 20:08 ` Eric Blake
2015-11-03 7:17 ` Markus Armbruster
2015-11-03 13:19 ` Luiz Capitulino
2015-11-03 13:38 ` Paolo Bonzini
2015-11-03 13:46 ` Luiz Capitulino
2015-11-03 13:53 ` Paolo Bonzini
2015-11-03 14:26 ` Luiz Capitulino
2015-11-03 14:53 ` Paolo Bonzini
2015-11-03 15:08 ` Markus Armbruster
2015-11-03 13:40 ` Eric Blake
2015-11-03 13:44 ` Daniel P. Berrange
2015-11-03 13:53 ` Luiz Capitulino
2015-11-02 13:17 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5633C8EC.8030309@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).