From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2Ui4-0004GP-5i for qemu-devel@nongnu.org; Thu, 25 Jul 2013 19:12:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2Ui3-0007fv-7w for qemu-devel@nongnu.org; Thu, 25 Jul 2013 19:12:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41449) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2Ui2-0007ex-UE for qemu-devel@nongnu.org; Thu, 25 Jul 2013 19:12:35 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6PNCYIb006058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Jul 2013 19:12:34 -0400 Message-ID: <51F1B0E0.5030208@redhat.com> Date: Thu, 25 Jul 2013 17:12:32 -0600 From: Eric Blake MIME-Version: 1.0 References: <1374584606-5615-1-git-send-email-kwolf@redhat.com> <1374584606-5615-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1374584606-5615-3-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AJ6N6WfSQxpJNMuT25iuFDaaQasF2jdLN" Subject: Re: [Qemu-devel] [PATCH 02/18] qapi-types.py: Implement 'base' for unions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: armbru@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AJ6N6WfSQxpJNMuT25iuFDaaQasF2jdLN Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/23/2013 07:03 AM, Kevin Wolf wrote: > The new 'base' key in a union definition refers to a struct type, which= > is inlined into the union definition and can represent fields common to= > all kinds. >=20 > For example the following schema definition... >=20 > { 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } } >=20 > { 'union': 'BlockOptions', > 'base': 'BlockOptionsBase', > 'data': { > 'raw': 'BlockOptionsRaw' > 'qcow2': 'BlockOptionsQcow2' > } } >=20 > ...would result in this generated C struct: >=20 > struct BlockOptions > { > BlockOptionsKind kind; > union { > void *data; > BlockOptionsRaw * raw; > BlockOptionsQcow2 * qcow2; > }; > bool read_only; > }; >=20 > Signed-off-by: Kevin Wolf > --- > scripts/qapi-types.py | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --AJ6N6WfSQxpJNMuT25iuFDaaQasF2jdLN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR8bDgAAoJEKeha0olJ0Nq3q4H/1IUlDcEJi9WCNlA4AhXyIAZ +FueFHqac1dOkpY4b9espp5YTtHFLv4AnHBmYd/9Vg6WvABNyD68n0Va3A2x/MGX FdNhUdMczxhNoB3uTUEXrq7Wey6kvIHRXMtBK/MAIQ8boSF77BrZuEJlMEJlpFWM iZJpRaWvQsr0G+diEhwSvoW+Sgf0g3aMMyYM+Z8ZNhq0iD9GSv3Ikv3qKxQmuMfQ fpRcHeXn+F2NWEc0fcrdbqIIi5oLiil1nQgoMhywe4aAmki5MlFN8XmKNORkJ/Aw vA6yObWNKiNbILKKmK/pcUAVhuYTzZuq+UX8LUwPiuE2kgoCuDN48zGYOXgVq4o= =jtM4 -----END PGP SIGNATURE----- --AJ6N6WfSQxpJNMuT25iuFDaaQasF2jdLN--