From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKUed-0006f9-4l for qemu-devel@nongnu.org; Wed, 29 Jul 2015 12:56:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKUeV-0002FB-No for qemu-devel@nongnu.org; Wed, 29 Jul 2015 12:56:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKUeV-0002F7-I6 for qemu-devel@nongnu.org; Wed, 29 Jul 2015 12:56:23 -0400 References: <1435782155-31412-1-git-send-email-armbru@redhat.com> <1435782155-31412-28-git-send-email-armbru@redhat.com> <55B6A40A.8070400@redhat.com> <874mkopyrj.fsf@blackfin.pond.sub.org> <55B7E8F7.6030604@redhat.com> <878u9zjsuh.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <55B905B0.9040301@redhat.com> Date: Wed, 29 Jul 2015 10:56:16 -0600 MIME-Version: 1.0 In-Reply-To: <878u9zjsuh.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cEj7sNggn5NX5uAtT4CU43H8JsxvX3npb" Subject: Re: [Qemu-devel] [PATCH RFC v2 27/47] qapi-visit: Convert to QAPISchemaVisitor, fixing bugs 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) --cEj7sNggn5NX5uAtT4CU43H8JsxvX3npb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/29/2015 02:00 AM, Markus Armbruster wrote: >>>> We don't have any code that demonstrates this, but probably should. = I >>>> ran into it while working up my POC of what it would take to unbox >>>> inherited structs (http://thread.gmane.org/gmane.comp.emulators.qemu= /353204) >>> >>> Is this broken in master, or do my patches break it? >>> >>> Got a reproducer? >> >> Turns out I'm mistaken; we got lucky. The call to >> generate_visit_struct_fields() creates a function for 'name' (aka the >> union name), and not for 'base' (aka the class name that owns the >> fields). So even if we have Base as a common struct between Child and= >> Union, the code emitted for Child generates visit_Base_fields(), while= >> the code emitted for Union generates visit_Union_fields(). >> >> So there is no reproducer, but _only_ as long as we reject unions as a= >> base class for any other object. And there is redundancy: we could >> reuse visit_Base_fields() for the sake of the union, then avoid >> (re-)visiting the discriminator, and we would no longer need to emit >> visit_Union_fields(). But I can do that as part of the followup >> cleanups; since I don't see anything broken with your patch, we don't >> have to worry about it during this series. >=20 > Good. Thank you! And here's a followup patch that cleans it up: http://thread.gmane.org/gmane.comp.emulators.qemu/353204/focus=3D353728 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cEj7sNggn5NX5uAtT4CU43H8JsxvX3npb 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/ iQEcBAEBCAAGBQJVuQWxAAoJEKeha0olJ0NqaRAH/ArS7fShg/f6yiMZ/TZQrXs8 B/A7g8ixxzFVYnx9ymRUtELjJDdzhVMzhaZ8lQxcLtXuV7maX0A8x6ljTUy8T2U+ eatCz2HnGyvzN0wE52aBOpqv9YWSxLKSpdaM2bt6ZizCpvsHZ7cN505Tih22l7Za 7QSxSdAUW/XXlpgWEOxKCezx5/qyi8u8xciLR0UXZ/tgmqiTpto0gqZ14cgng7KO wjewy2HQYW9Qv/xvSSVHOoswzByHcWlMSFUS4qYhKnpiFUr4A1T8RTohon/SsSAm n55zG1IYMM0WvcJUaf8/NhKHhMf0YgHp2I8vZMlWPTigRmbKQduPrX90LVv2Ba8= =Bg2i -----END PGP SIGNATURE----- --cEj7sNggn5NX5uAtT4CU43H8JsxvX3npb--