From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gyr-00047V-3e for qemu-devel@nongnu.org; Thu, 10 Jul 2014 12:14:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5Gyk-0007vX-Ba for qemu-devel@nongnu.org; Thu, 10 Jul 2014 12:13:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gyk-0007ut-3v for qemu-devel@nongnu.org; Thu, 10 Jul 2014 12:13:50 -0400 Message-ID: <53BEBBBA.5000509@redhat.com> Date: Thu, 10 Jul 2014 10:13:46 -0600 From: Eric Blake MIME-Version: 1.0 References: <20140708141728.412a3f1c@redhat.com> <87fvi9i8tx.fsf@blackfin.pond.sub.org> In-Reply-To: <87fvi9i8tx.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xPPiJN6oRd8xNPiu7cfxMaakhQlWPqKmI" Subject: Re: [Qemu-devel] [PATCH] scripts: qapi-event.py: support vendor extension List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Luiz Capitulino Cc: qemu-devel , wenchaoqemu@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xPPiJN6oRd8xNPiu7cfxMaakhQlWPqKmI Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/10/2014 08:31 AM, Markus Armbruster wrote: > Luiz Capitulino writes: >=20 >> The event code generator barfs when it sees a dot in an event >> argument, this makes it impossible to support vendor extensions >> in event arguments as they always contain dots. Fix this by >> replacing dots by hyphens in the generated code. >=20 > Code replaces by underbar, not hyphen. >=20 >> PS: Event names and QMP command arguments may suffer from the >> same issue, but I'm not checking/fixing them today. >> >> Signed-off-by: Luiz Capitulino >> --- >> +# Should be used where vendor extensions are supported >> +def c_arg(name): >> + return c_var(name).replace('.', '_') >> + >> def c_list_type(name): >> return '%sList' % name >=20 > Can anybody think of a use of c_var() that needs '.' preserved? If the generator spits out any comments, those comments should refer to the QMP wire name, including the '.'. But right now, generated code doesn't seem to do that. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --xPPiJN6oRd8xNPiu7cfxMaakhQlWPqKmI 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/ iQEcBAEBCAAGBQJTvru6AAoJEKeha0olJ0NqbNQH/jxXIHd0SNwmikYfSfQCH/GX PcE9eYGMNZ+QkhRx0hBUwHxWaVMt91OyoaGFjVnFdEjK8aQ7M9vsFxYZBF3VC+OZ Q/2pYXN5ySSOB5YkSieGl0Co1b5tCC5xayN1LmfYur5Zjv85aiwm2VdYL39jFm73 HuXjzEwc83S0sF/wbh8e7EnZlBaZGOSSmw7fSsBOdEJ1m+044mLcwuQowHk1sDe0 a2F1s+1P8T3tyt0Tp+YHnhlWRF6j+cXlk6CxfwPb/HU0aJLiPfMulmzhD+RnLV3R dTya4iC8WYph+kYv6F5jN5S3qTkP759gDvXeiM99FVSTHqoRwYYYjbrZsEgMu40= =KvST -----END PGP SIGNATURE----- --xPPiJN6oRd8xNPiu7cfxMaakhQlWPqKmI--