From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtfTI-0006P4-1W for qemu-devel@nongnu.org; Tue, 03 Nov 2015 12:34:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtfTF-0000w5-AX for qemu-devel@nongnu.org; Tue, 03 Nov 2015 12:34:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtfTF-0000vg-1w for qemu-devel@nongnu.org; Tue, 03 Nov 2015 12:34:09 -0500 References: <871tc8tnsl.fsf@blackfin.pond.sub.org> <1446504092-29008-2-git-send-email-eblake@redhat.com> <87611jjq98.fsf@blackfin.pond.sub.org> <5638B613.2020402@redhat.com> <87mvuvch9x.fsf@blackfin.pond.sub.org> <5638C0E8.1020102@redhat.com> <8737wn5a40.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <5638F00F.9050805@redhat.com> Date: Tue, 3 Nov 2015 10:34:07 -0700 MIME-Version: 1.0 In-Reply-To: <8737wn5a40.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ePmXnspafuPUdHDEWifMWJ2nAflggbgl3" Subject: Re: [Qemu-devel] [PATCH v8.5 1/4] qapi: Drop all_members parameter from check() 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) --ePmXnspafuPUdHDEWifMWJ2nAflggbgl3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/03/2015 09:19 AM, Markus Armbruster wrote: >>> I'm assuming this patch is based on >>> [PATCH v8 06/17] qapi-types: Consolidate gen_struct() and gen_union()= >>> which has >>> >>> def check(self, schema, members, seen): >>> if self.tag_name: # flat union >>> self.tag_member =3D seen[self.tag_name] >>> elif seen: # simple union >>> assert self.tag_member in seen.itervalues() >>> else: # alternate >>> ---> self.tag_member.check(schema, members, seen) >>> >>> in QAPISchemaObjectTypeVariants. >> >> That was true in v8, but not in my pending v9 which did essentially wh= at >> your 7/7 did (move the tag_member.check() into Alternate.check() back = in >> patch 5). Caused me some churn in incorporating your patches, but not too bad. >> >> At any rate, my first glance of your series shows that it is reasonabl= e, >> so my task today is to spit out a v9 of my series, but using your seve= n >> patches in place of my four. >=20 > Buyer beware: I'm not sure my seven do everything your four do. Yours do the same as my patch 1. You also made a compelling argument for eliminating my patch 3 (the enum values are already collision-proof, therefore if we check that a variant name is in the enum, we don't need to check for collisions) - except that in my 10/17, when I get rid of the generated enum for alternates, I have to reinstate that check somewhere; but adding it directly to QAPISchemaAlternateType.check() at that point feels better. My patch 2 is still needed, but looks a bit nicer on top of some of your refactoring. And my patch 4 is still useful, as additional refactoring to share the code used by my patch 2 and your code for ObjectType.check()= =2E We'll see how it all turns out in v9. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ePmXnspafuPUdHDEWifMWJ2nAflggbgl3 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/ iQEcBAEBCAAGBQJWOPAPAAoJEKeha0olJ0NqqxsH/A2nhhlNdZoJOYMxdqgdy/We zqhJ9KtfilP6Rx3cTkVQyyMMY5sFP2UgH6+IHB9hmhJNgxBUbsrQl4BGtKnRd3qU WRwhJLWkr9ajThram9oj6f6M1XMyiU+iWleT8XjISDrTeWnwp6romMfndW6pADvd LgGysSgzA+jX9s25zorzIkF61oaf6I7i+yAulke1JgU0wU/2/y8rmxsudtDxu/JS jurTOyyGUNEB7eJVvlYs0mc2oDo1UendXQrTguAYPk1ebeuE+mjXG/D5xggQz0l1 rJrKsSCqJ3F9JiW+iU3gKZWHydgihBfKYu8zx26Fevivsg/ly5myag/D4oK8CB8= =CU1k -----END PGP SIGNATURE----- --ePmXnspafuPUdHDEWifMWJ2nAflggbgl3--