From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zplq6-0005Zr-PV for qemu-devel@nongnu.org; Fri, 23 Oct 2015 19:33:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zplq3-0002gQ-J9 for qemu-devel@nongnu.org; Fri, 23 Oct 2015 19:33:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zplq3-0002gM-Ba for qemu-devel@nongnu.org; Fri, 23 Oct 2015 19:33:35 -0400 References: <1445056549-7815-1-git-send-email-eblake@redhat.com> <1445056549-7815-6-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <562AC3CD.3000208@redhat.com> Date: Fri, 23 Oct 2015 17:33:33 -0600 MIME-Version: 1.0 In-Reply-To: <1445056549-7815-6-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AkP2OU2AuTg2ErOTg5uCnkxbjCV5op8L7" Subject: Re: [Qemu-devel] [PATCH v7 05/14] qapi: Rework collision assertions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AkP2OU2AuTg2ErOTg5uCnkxbjCV5op8L7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/16/2015 10:35 PM, Eric Blake wrote: > Now that we have separate namespaces for QMP vs. tag values, > we can simplify how the QAPISchema*.check() methods check for > collisions. Each QAPISchemaObjectTypeMember check() call is > given a single set of names it must not collide with; this set > is either the QMP names (when this member is used by an > ObjectType) or the case names (when this member is used by an > ObjectTypeVariants). We no longer need an all_members > parameter, as it can be computed by seen.values(). When used > by a union, QAPISchemaObjectTypeVariant must also perform a > QMP collision check for each member of its corresponding type. >=20 > The new ObjectType.check_qmp() is an idempotent subset of > check(), and can be called multiple times over different seen > sets (useful, since the members of one type can be applied > into more than one other location via inheritance or flat > union variants). >=20 > The code needs a temporary hack of passing a 'union' flag > through Variants.check(), since we do not inline the branches > of an alternate type into a parent QMP object. A later patch > will rework how alternates are laid out, by adding a new > subclass, and that will allow us to drop the extra parameter. >=20 > There are no changes to generated code, and we can now add a > positive test to qapi-schema-test that proves that alternates > can now use names that would previously trigger assertions > (see commit 7b2a5c2f for an example of the failure that was > still possible for alternates before this commit). >=20 > Future patches will add more positive tests, improve error > message quality on actual collisions, and move collision > checks out of ad hoc parse code into the check() methods. This paragraph may be a bit out of date based on rebasing that I've done, but one patch for sure that needs to come later is deferring subset B v10 24/25 to after this point. The patch itself should be in good state for reviewing, even if the commit message needs massaging. >=20 > Signed-off-by: Eric Blake >=20 > --- > v7: new patch, although it is a much cleaner implementation of > what was attempted by subset B v8 15/18 > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg03042.html --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --AkP2OU2AuTg2ErOTg5uCnkxbjCV5op8L7 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/ iQEcBAEBCAAGBQJWKsPNAAoJEKeha0olJ0NqK+AIAKKdBW+1PGZDLruxqtc4S4PU qNMYSdUhRO1fafMoWOClGeDH+J/km8HIP8D4RtF+wC4RTWspV+pMZimf5eSCVW33 /MVUIXCoKX718BxdAbc8bcI0L1g2adqD5KYvzmTVNGwA8UG/d5YBOZtVWBRzKkOX KUo/DbTQjHLRbT1WTGv2O7WNcWcZNC0+StwdM5eE2Bh23kJh7bwqar3JQYFAETh6 TsJvEpdNeH9Sw/Y8WQdAeJVeIKq2ZFjsQnpkF994jdusLSujXgg9+L4LJS4mdWZr V0i2O1ViWczuzNr2r+joN+BZV5cHVbd9gKWl3zxN5iIyYQB+cgS1jb+D4D/vKRU= =HUR6 -----END PGP SIGNATURE----- --AkP2OU2AuTg2ErOTg5uCnkxbjCV5op8L7--