From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>, Qemu-block <qemu-block@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Jeff Cody <jcody@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] Jobs 2.0 QAPI [RFC]
Date: Fri, 18 Dec 2015 14:46:14 -0700 [thread overview]
Message-ID: <56747EA6.8070209@redhat.com> (raw)
In-Reply-To: <5674799F.9010006@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2115 bytes --]
On 12/18/2015 02:24 PM, John Snow wrote:
>> To be subclassable, we need a flat union, and the discriminator must be
>> non-optional within that union. Either 'options' is that flat union
>> (and we have a layer of {} nesting in QMP}, or we directly make the
>> 'data' of job-cancel be the flat union (no need for an "options":{}
>> nesting in QMP); the latter still depends on some of my pending patches,
>> but we'll get there in plenty of time.
>>
>
> Ah, shame. It would have been nice to delay interpretation of the union
> pending the result of the Job lookup.
Yeah, I don't think dynamic parsing is going to fly in the qapi
generator; right now it works as "parse the entire JSON string into a
QObject, validate that it can be converted to a qapi type, then pass
that to the marshaller"; whereas a dynamic parse would require more like
"parse half the JSON, call the first marshaller to see what else to
parse, finish the parse, and now dispatch to the second marshaller".
>
> If the discriminator must always be present, though, then so be it.
Maybe a future patch can make it optional (if the discriminator is
missing, do a tentative parse of all remaining fields, and as long as
exactly one branch is happy with the result, then we know what
discriminator to fill in). But I'm not sure it's worth the complexity,
when it's easier to just tell clients to always pass a discriminator.
> I'll give it a college try and send some actual patches for x-job-query,
> x-job-cancel, etc.
>
> For the flat union support on the top level as hinted for job-cancel,
> what branch of yours should I develop on top of?
http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi has all my
pending patches in the state last posted to the list, although it will
be non-fast-forwarded as I rebase to latest (I already know that today's
state of that branch doesn't build on today's qemu.git master, now that
2.6 is open and some churn has started creeping in).
--
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 prev parent reply other threads:[~2015-12-18 21:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 0:50 [Qemu-devel] Jobs 2.0 QAPI [RFC] John Snow
2015-12-18 18:07 ` Eric Blake
2015-12-18 21:24 ` John Snow
2015-12-18 21:46 ` Eric Blake [this message]
2015-12-21 12:31 ` Kevin Wolf
2015-12-21 17:45 ` John Snow
2015-12-21 16:58 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2015-12-21 19:40 ` John Snow
2015-12-22 16:19 ` Alberto Garcia
2015-12-22 16:21 ` John Snow
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=56747EA6.8070209@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=jcody@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--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).