From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTuyK-0000BO-7a for qemu-devel@nongnu.org; Mon, 24 Aug 2015 12:51:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTuyF-0000bV-8z for qemu-devel@nongnu.org; Mon, 24 Aug 2015 12:51:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTuyF-0000bJ-3C for qemu-devel@nongnu.org; Mon, 24 Aug 2015 12:51:43 -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> <55DB1716.10502@redhat.com> From: Eric Blake Message-ID: <55DB4B99.80404@redhat.com> Date: Mon, 24 Aug 2015 10:51:37 -0600 MIME-Version: 1.0 In-Reply-To: <55DB1716.10502@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oViLjGOp6ibO22hhmnbq3uWu4iF8N3Pgi" 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) --oViLjGOp6ibO22hhmnbq3uWu4iF8N3Pgi Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/24/2015 07:07 AM, Eric Blake wrote: > Where things would NOT be allowed due to our prohibition of nested > structs is: >=20 > { 'union': 'Flat', 'base': 'Base', 'discriminator': 'type', > 'data': { 'okay': 'str', 'bad': { 'i': 'int' } } } I typed that wrong. { 'union': 'Flat', 'base': 'Base', 'discriminator': 'type', 'data': { 'branch1': 'NamedTypeOkay', 'branch2': { 'anon-type-okay': 'str' }, 'branch3': { 'okay': str', 'bad-nesting': { 'i': 'int' } } } = } and where anonymous types are still okay is that if we add long-hand for expressing optional types, or otherwise use a dict in place of a type, we can do: { 'union': 'Flat', 'base': 'Base', 'discriminator': 'type', 'data': { 'branch1': 'NamedTypeOkay', 'branch2': { 'anon-type-okay': { 'type': 'str', 'optional': true } } } } , That is, there is a difference between the dictionary expressing an anonymous type, and the dictionary expressing additional attributes belonging to a member of a struct. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --oViLjGOp6ibO22hhmnbq3uWu4iF8N3Pgi 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/ iQEcBAEBCAAGBQJV20uZAAoJEKeha0olJ0NqO3wH/Rv59rplYGb2XFn6Ovc/fB9o cWI3SxRmARJYZCQ9QSmePVt8Nmg1+CuaRKMXka0c+uHxJWjh9GO8KktThjse0HV8 IMWPYFEQe1xtoLY1awXRYqHAAT4K4TB2r5EUSzsFIY6vVfqeUHFlfZove5M1+E6C Ztt2MhtECw4+7sePsLRnEESwHT4SdnSCQI0Ga4Yc3NDKHA+RgM0ntXQRV+ZrN/PY qfpiba8EEoPaUNPBpgOzEF2RLfFH4Et0AafBqES66GGEcRcISzTxUsx2elylRGjP wmUuYbfgQW/esspDn9oPfIF4wOliOn4mD8hy6D79kqD/SL7t1rINQNzWC9/eweU= =LMVr -----END PGP SIGNATURE----- --oViLjGOp6ibO22hhmnbq3uWu4iF8N3Pgi--