From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcEXC-0003DD-77 for qemu-devel@nongnu.org; Wed, 16 Sep 2015 11:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcEX7-0004MK-Kz for qemu-devel@nongnu.org; Wed, 16 Sep 2015 11:22:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcEX7-0004Lx-FI for qemu-devel@nongnu.org; Wed, 16 Sep 2015 11:22:05 -0400 References: <1442401589-24189-1-git-send-email-armbru@redhat.com> <1442401589-24189-5-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55F98917.3010009@redhat.com> Date: Wed, 16 Sep 2015 09:21:59 -0600 MIME-Version: 1.0 In-Reply-To: <1442401589-24189-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TugcFNhCsg2j5A6RuN4BhkUWmIMevukJi" Subject: Re: [Qemu-devel] [PATCH v8 04/26] qapi: New QAPISchemaVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TugcFNhCsg2j5A6RuN4BhkUWmIMevukJi Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/16/2015 05:06 AM, Markus Armbruster wrote: > The visitor will help keeping the code generation code simple and > reasonably separated from QAPISchema details. >=20 > Signed-off-by: Markus Armbruster > --- > scripts/qapi.py | 64 +++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 64 insertions(+) >=20 > @@ -840,6 +876,10 @@ class QAPISchemaEnumType(QAPISchemaType): > def json_type(self): > return 'string' > =20 > + def visit(self, visitor): > + visitor.visit_enum_type(self.name, self.info, > + self.values, self.prefix) Thinking aloud: Should this visit 'self.prefix or self.name', rather than letting callers see None? If we did that, we could simplify c_enum_const() back to 2 parameters, and update all callers to just blindly pass the prefix instead of the enum name. On the other hand, I think that's a bit too much churn, and I don't see what it would buy us that we don't already have with a 3-arg c_enum_const(). So I'm fine with the version you have here as-is (modulo any obvious rebase to pass self._prefix based on my comments on 2). Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --TugcFNhCsg2j5A6RuN4BhkUWmIMevukJi 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/ iQEcBAEBCAAGBQJV+YkXAAoJEKeha0olJ0NqtpcIAI5gS2l0fosDLrRQ7ATn0ZFv OGiiNcvZAQ9tIJFzXK2kQQIm+7HvBXA1I/okj0/k/wVf/vJbhJ/C6MSYW4d7uoY9 E5BxtZhs9DFWUu4ZgU9upFcA7BocSdiDV69CSqgfDAwTnKlMCt4dyckH5WiZr3VV AKeKKHddBMaERtURYjROe49g7x3wCZoxs++jCSujPw0Zrs6QkXVrzaGw9xdf13w5 Ykic8GznCNjKwQvVXBQijwjynbfWTz8clqa3uKD1+I1wdfGtAi7kW5ZjsCHpWyqO 7+tS7CrolzuDqqpeyXo4iiYwa2Amo2LOKUusMYlLFmQnecpxLo+sGzx9rw38wbg= =G45/ -----END PGP SIGNATURE----- --TugcFNhCsg2j5A6RuN4BhkUWmIMevukJi--