From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTrTV-0004Uf-Mo for qemu-devel@nongnu.org; Mon, 24 Aug 2015 09:07:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTrTR-0003gn-Mu for qemu-devel@nongnu.org; Mon, 24 Aug 2015 09:07:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTrTR-0003gg-Fw for qemu-devel@nongnu.org; Mon, 24 Aug 2015 09:07:41 -0400 References: <1438703896-12553-1-git-send-email-armbru@redhat.com> <1438703896-12553-31-git-send-email-armbru@redhat.com> <55D94951.3020109@redhat.com> <87egisq5xu.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <55DB1716.10502@redhat.com> Date: Mon, 24 Aug 2015 07:07:34 -0600 MIME-Version: 1.0 In-Reply-To: <87egisq5xu.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dHuwI7xuux5QRILl1a26WVMHh37hREt5r" Subject: Re: [Qemu-devel] [PATCH RFC v3 30/32] qapi: New QMP command query-schema for QMP schema introspection List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dHuwI7xuux5QRILl1a26WVMHh37hREt5r Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/24/2015 05:30 AM, Markus Armbruster wrote: >> We mentioned moving this into its own patch. In particular, I looked = at >> what it would take to allow anonymous structs for flat union types: >> >> { 'union': 'Flat', 'base': 'Base', >> 'discriminator': 'type', >> 'data': { 'branch1': {}, This one is particularly handy - it would avoid the need to create dummy types like 'Abort' that exist solely to satisfy the current qapi grammar.= >> 'branch2': { 'integer': 'int' } } } This one is a bit harder to justify, but may still be useful. >=20 > We used to support inline structs in a few places, but dropped it > (commit 6b5abc7). Do we really want to add them back in other places? We dropped nested structs, not anonymous structs. For comparison, here's an anonymous command struct: { 'command': 'foo', 'data': { 'i': 'int' } } vs. the corresponding named version: { 'struct': 'Foo', 'data': { 'i': 'int' } } { 'command': 'foo', 'data': 'Foo' } Where things would NOT be allowed due to our prohibition of nested structs is: { 'union': 'Flat', 'base': 'Base', 'discriminator': 'type', 'data': { 'okay': 'str', 'bad': { 'i': 'int' } } } >=20 > Both Abort and ChardevDummy exist only because you need a type to > declare a simple union case. I'd like to explore cleaning up the > convoluted union syntax first. If we then still have a need for empty > structs, we can consider optimizing them. And that's where my patches were headed - by allowing a dict instead of a type name for the branches of a flat union, the syntax for flat unions becomes simpler, and allows us to sanely represent a "no-additional-members" variant without needing 'Abort' as an empty type.= --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --dHuwI7xuux5QRILl1a26WVMHh37hREt5r 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/ iQEcBAEBCAAGBQJV2xcbAAoJEKeha0olJ0Nqq3IH/jT3mLYNNNDYdVdGcJW0Xdj6 W2fcyo4zxrQMU3iKsmPfHHUwPi55oiV1OxAPh/r3VYmutfGsJV+zZ7W0jtEM05v2 R8V6MjRoqS6oDH4zvRlAllrNnD0jaW5kQYhh0jcaHXob+/TOYfP1SVQcPnG14huO UOP57G0Yomqcxauzel4ybuuVMI0w6wHgU6ZQYgDR5wPioooruTNJGmFJO7zNDxV8 k2+9jddF+7ggr6+0nvGAmvgQRvZvNC4KlTtOb3nS4+J5v/xiA07Zhl/+otC1S7i4 p1bEtamiIUshioS94ABhTgAh1cJH9GBhOLTEFg1CFoftyJAT3Y72/sjuQq+SuUg= =xjHD -----END PGP SIGNATURE----- --dHuwI7xuux5QRILl1a26WVMHh37hREt5r--