From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ybah7-00012d-Es for qemu-devel@nongnu.org; Fri, 27 Mar 2015 16:17:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ybah4-00004t-6X for qemu-devel@nongnu.org; Fri, 27 Mar 2015 16:17:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ybah3-0008WS-Ta for qemu-devel@nongnu.org; Fri, 27 Mar 2015 16:17:26 -0400 Message-ID: <5515BAD3.401@redhat.com> Date: Fri, 27 Mar 2015 14:17:23 -0600 From: Eric Blake MIME-Version: 1.0 References: <1427227433-5030-1-git-send-email-eblake@redhat.com> <1427227433-5030-22-git-send-email-eblake@redhat.com> <87oane8iru.fsf@blackfin.pond.sub.org> In-Reply-To: <87oane8iru.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L2XD9Pu9OuUiROgccKh8eArJsJCrKBwNq" Subject: Re: [Qemu-devel] [PATCH v5 21/28] qapi: Require valid names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, lcapitulino@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, wenchaoqemu@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --L2XD9Pu9OuUiROgccKh8eArJsJCrKBwNq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/27/2015 11:14 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Previous commits demonstrated that the generator overlooked various >> bad naming situations: >> - types, commands, and events need a valid name >> - union and alternate branches cannot be marked optional >> >> The set of valid names includes [a-zA-Z0-9._-] (where '.' is >> useful only in downstream extensions). >> >> >> +valid_characters =3D set(string.ascii_letters + string.digits + '.' += '-' + '_') >> +def check_name(expr_info, source, name, allow_optional =3D False): >> + membername =3D name >> + >> + if not isinstance(name, str): >> + raise QAPIExprError(expr_info, >> + "%s requires a string name" % source) >> + if name =3D=3D '**': >> + return >=20 > I'm afraid this conditional is superfluous or wrong. Our schemata don'= t > trigger it. Hmm, you're right. Given a 'name':'type' pair in a dictionary, check_name is used on the 'name' portion; but we only use 'name':'**' (and NOT '**':'type') in the schemata. I'll drop it in the respin. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --L2XD9Pu9OuUiROgccKh8eArJsJCrKBwNq 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVFbrTAAoJEKeha0olJ0Nq++0H/06yQZmevWFbGZSSeF4CwNxC qzW6ZBObYK9Q+boDBNuS1NUbOGjbIW3yPNNK8DYEM8t/2UzG2Pw8xpZxVORK3Z6m e12+0AYMVEzEPoZ0jemKYDhs18DFp8LeZjwKF9fDcC1RSDT1/iyiFShh9ZwsPuAZ i7popVW9rX9KvjCdR7T72xl1UkikB4f2iIUtfw/ME4Ualu1auqsL8Fq7mkN/9PnY eR+lOsMPc2SfrTZU+naAO4ve3k9gKlzdmLR5gE5lefQF2jo5c2APaSajJCdhdLG9 kGKpvzt3TITPtmZYQVlFoPAJbZ5xmaWoCXkVIYU/trdYF94DH+O1srtgnBZqaL8= =sge5 -----END PGP SIGNATURE----- --L2XD9Pu9OuUiROgccKh8eArJsJCrKBwNq--