From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA2r5-0001zD-Eu for qemu-devel@nongnu.org; Fri, 18 Dec 2015 16:46:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aA2r4-0005hR-FV for qemu-devel@nongnu.org; Fri, 18 Dec 2015 16:46:27 -0500 References: <567206C0.6010403@redhat.com> <56744B65.6030006@redhat.com> <5674799F.9010006@redhat.com> From: Eric Blake Message-ID: <56747EA6.8070209@redhat.com> Date: Fri, 18 Dec 2015 14:46:14 -0700 MIME-Version: 1.0 In-Reply-To: <5674799F.9010006@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0Wbtem2Hg5DKaRJqRrrk1ThEnnfr2aovd" Subject: Re: [Qemu-devel] Jobs 2.0 QAPI [RFC] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , Qemu-block Cc: Kevin Wolf , Jeff Cody , qemu-devel , Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0Wbtem2Hg5DKaRJqRrrk1ThEnnfr2aovd Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/18/2015 02:24 PM, John Snow wrote: >> To be subclassable, we need a flat union, and the discriminator must b= e >> 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 patche= s, >> but we'll get there in plenty of time. >> >=20 > 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". >=20 > 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. >=20 > 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). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0Wbtem2Hg5DKaRJqRrrk1ThEnnfr2aovd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWdH6mAAoJEKeha0olJ0Nq+zIH/2QcSr5L4cS0EgR2yKV6hnHA zDfJuDZGSCqOc64gGY5yW5RLO6MIMFQONYpkEm66H/gPHZD2xkjl688Nt5kpXezC HyqDp3E0xcL1quuvBwOf9XE1m9EUoepSZzBz+40bu2UDJuYjBipfn8eRswJQrFnI F2fnxJjsMX9Ml6Hi0OFB9vgG7GoCIFRwcKMnQFR6HlLkEEfJWOEX9Zu0NIJnPFeF 9Fj6i9Dei0fckF7jA8wyzzcxrkz8Ab83McEKArQv1QHLAi9+XHFMnerFP+IbM/VI 6kAFoaUMNHR1mHklOnsI3wbNFHkpn9j+m+biuH33GdhrSBC6nICMaOndp8KxUY4= =y1iR -----END PGP SIGNATURE----- --0Wbtem2Hg5DKaRJqRrrk1ThEnnfr2aovd--