From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzMu-0006Pu-R2 for qemu-devel@nongnu.org; Tue, 13 Oct 2015 09:11:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlzMs-0000Hi-31 for qemu-devel@nongnu.org; Tue, 13 Oct 2015 09:11:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58293) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlzMr-0000HO-Ry for qemu-devel@nongnu.org; Tue, 13 Oct 2015 09:11:50 -0400 References: <1444710158-8723-1-git-send-email-eblake@redhat.com> <1444710158-8723-12-git-send-email-eblake@redhat.com> <87bnc37ys4.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <561D0314.9020304@redhat.com> Date: Tue, 13 Oct 2015 07:11:48 -0600 MIME-Version: 1.0 In-Reply-To: <87bnc37ys4.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AJTXFTBGjdmoSX50ngOj6xM715d99UeTv" Subject: Re: [Qemu-devel] [PATCH v8 11/18] qapi: Simplify gen_struct_field() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AJTXFTBGjdmoSX50ngOj6xM715d99UeTv Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/13/2015 06:12 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Rather than having all callers pass a name, type, and optional >> flag, have them instead pass a QAPISchemaObjectTypeMember which >> already has all that information. >> >> This will allow a future patch to simplify alternates to use >> a special tag 'qtype_code type'. In the meantime, it requires >> a hack to create a temporary member 'base' for struct base >> classes; this temporary member will go away in a later patch >> that flattens structs in the same way that flat union base >> classes were flattened in commit 1e6c1616. >> >> No change to generated code. >> >> Signed-off-by: Eric Blake >> >> >> if base: >> - ret +=3D gen_struct_field('base', base, False) >> + # TODO Flatten this struct, similar to flat union bases. Unti= l >> + # then, hack around it with a temporary member. >> + member =3D QAPISchemaObjectTypeMember('base', base.name, Fals= e) >> + member.type =3D base >> + ret +=3D gen_struct_field(member) >> >> ret +=3D gen_struct_fields(members) >=20 > Uff! Are you really, really sure this is the right spot in the series > for this transformation? Serves me right for sending the series late at night. I can probably delay this transformation to a later subset, after I have unboxed struct base members, so I won't need this hack. And I just confirmed that nothing else in subset B depends on this patch, so let's defer it to subset C or later (dropping from this series is not sufficient reason for a v9 respin, but if something else turns up that needs a v9, this patch has been moved out). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --AJTXFTBGjdmoSX50ngOj6xM715d99UeTv 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/ iQEcBAEBCAAGBQJWHQMUAAoJEKeha0olJ0Nq+sAIAJ1XjPmkexH6DWxrflRLwgUd GAjupcRlQ1QRTFwInNcr6sEByNv67Mcy0rh7TYGnS9w1yI3bhoTjJDqjEiA1LDDc APJtiNHHJefwzHtAoEqDWMpnZe3V52OigKUf4N4OPpcw12B0l4swLsxc0M6aQh1v vpYR3T3u/TVFF08CsrEz44sRZyVBph8D/XVYaSKHvmVzd7d6od3DbatBVXUc1fsP SHVm0o2MFD6Wh5bNTueBFKNhKUPyA0ZctF7oDPmLFL6m2OT/q/yKO2on43ltlBIM ZkM//U8b3DSiUSwS+CrXLcF+2YReeBsS94YEVCzs99BmO4F5Ukk5o2HzrDDRH/M= =TRta -----END PGP SIGNATURE----- --AJTXFTBGjdmoSX50ngOj6xM715d99UeTv--