From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHu6j-0000Jy-Lr for qemu-devel@nongnu.org; Thu, 14 Aug 2014 08:26:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHu6e-0005Ft-Ro for qemu-devel@nongnu.org; Thu, 14 Aug 2014 08:26:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHu6e-0005Fc-Jc for qemu-devel@nongnu.org; Thu, 14 Aug 2014 08:26:12 -0400 Message-ID: <53ECAAE0.2000105@redhat.com> Date: Thu, 14 Aug 2014 06:26:08 -0600 From: Eric Blake MIME-Version: 1.0 References: <1407287673-20308-1-git-send-email-eblake@redhat.com> <1407287673-20308-7-git-send-email-eblake@redhat.com> <87k36bjtrp.fsf@blackfin.pond.sub.org> In-Reply-To: <87k36bjtrp.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="stbtKlhhIU33n84NX9WSsRbbFXgTJIn73" Subject: Re: [Qemu-devel] [PATCH v3 06/14] qapi: require valid expressions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Luiz Capitulino , Fam Zheng , qemu-devel@nongnu.org, wenchaoqemu@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --stbtKlhhIU33n84NX9WSsRbbFXgTJIn73 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/14/2014 03:38 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> The previous patch demonstrated that the generator could get >> confused if an expression had conflicting meta-types, and >> silently ignored expressions that lacked a known meta-type. >> Fix both cases to give a sane error message. >> >> * scripts/qapi.py (check_exprs): Require a valid meta-type for >> every expression. >> * tests/qapi-schema/indented-expr.*: Use valid types. >> * tests/qapi-schema/missing-type.*: Update expected output. >> * tests/qapi-schema/double-type.*: Likewise. >=20 > Conventional git commit message followed by GNU change log. Unusual in= > QEMU. Same elsewhere. Habits die hard :) >=20 > Explanation of the change to indented-expr.json hides in the change log= > part, where I promptly missed it :) Okay, I'll make the subject line capitalized (which is more popular, even if not universal) and ditch the GNU style suffix (inlining any meat into the paragraph form) on my respin. >> + # 'include' has already been flattened; at this point, all ex= prs >> + # should have one of the remaining keys >> + keys =3D (expr.has_key('enum') + expr.has_key('union') + >> + expr.has_key('type') + expr.has_key('command') + >> + expr.has_key('event')) >> + if keys < 1: >> + raise QAPIExprError(info, >> + "Missing expression meta-type") >> + if keys > 1: >> + raise QAPIExprError(info, >> + "Conflicting expression meta-types") >> + >> if expr.has_key('union'): >> check_union(expr, info) >> if expr.has_key('event'): >=20 > Not the friendliest error messages, but they'll do. I'm open to bike-shedding suggestions :) But in the absence of a suggestion, I'll keep this part unchanged in v4. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --stbtKlhhIU33n84NX9WSsRbbFXgTJIn73 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT7KrgAAoJEKeha0olJ0Nq7U0H/jAt682IBxG4sLvRIvH46HBn DGN5xVpgHUQ17h656EQ4sVZw7xuKWhCtT0nI/2miEiEE7YervyEFTgp3MXR1Uqz+ ZyVgiKDH4bpYMR/aTw67JZBQoIULx3sXfoIQQiXXMNb4KN+GDe52s692jhUtOf7S uzc3arzXH/tj6iPgbnCbqqk2Am1J5Y4NToQJPIE+gKfheFleuqNtSAwJQYPABBF+ rWsEqpXE9PbQXQkc7neBjCWf42mUkAheH592Av3QLWBZdmg8oxk4INHQfptb3Hyx 3Dk4FV9fKGHPgS5sdDr/2a0P0HnPF+KbSHKU9Nn98eFOHZcqRcJ2b/Cbv7HLbLo= =QWG0 -----END PGP SIGNATURE----- --stbtKlhhIU33n84NX9WSsRbbFXgTJIn73--