From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMkfQ-0004nt-QU for qemu-devel@nongnu.org; Tue, 04 Aug 2015 18:26:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMkfM-0001eu-3x for qemu-devel@nongnu.org; Tue, 04 Aug 2015 18:26:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMkfL-0001ek-U1 for qemu-devel@nongnu.org; Tue, 04 Aug 2015 18:26:36 -0400 References: <1438703896-12553-1-git-send-email-armbru@redhat.com> <1438703896-12553-5-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55C13C19.2000609@redhat.com> Date: Tue, 4 Aug 2015 16:26:33 -0600 MIME-Version: 1.0 In-Reply-To: <1438703896-12553-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DEcGg5CflDsX4EnDKFUVue6dsN7jcaS03" Subject: Re: [Qemu-devel] [PATCH RFC v3 04/32] qapi: New QAPISchemaVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DEcGg5CflDsX4EnDKFUVue6dsN7jcaS03 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/04/2015 09:57 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 > Reviewed-by: Eric Blake > --- > scripts/qapi.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 46 insertions(+) >=20 > diff --git a/scripts/qapi.py b/scripts/qapi.py > index 3c596c3..019d22c 100644 > --- a/scripts/qapi.py > +++ b/scripts/qapi.py > @@ -771,6 +771,29 @@ class QAPISchemaEntity(object): > return c_name(self.name) > def check(self, schema): > pass > + def visit(self, visitor): > + pass > + > +class QAPISchemaVisitor(object): > + def visit_begin(self): > + pass Don't know if you wanted to hoist from later patches, and write this as: def visit_begin(self, schema): > @@ -1166,6 +1206,12 @@ class QAPISchema(object): > for ent in self.entity_dict.values(): > ent.check(self) > =20 > + def visit(self, visitor): > + visitor.visit_begin() and this as visitor.visit_begin(self) up front, for less churn later on. Not the end of the world to leave it as is, so my R-b stands either way. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --DEcGg5CflDsX4EnDKFUVue6dsN7jcaS03 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/ iQEcBAEBCAAGBQJVwTwaAAoJEKeha0olJ0NqIyIH/1n1mzNz/fUdnwZu7aJZKcQz C3kJd61gGOci7/rgcyC7thhacnzTk7F90Hou4O5svhHwkKFOrQYDIWWq9dLDhRAy JrKKLDZ4obk75UgP5gvuQuhhuIl9agmCSxtyizWPYhbFjP1QGaB8FIkfQ1Gr0olM eVV0cmkrAFqookIOcYgLzu50fdFauJJKA6m2oabzwmVhZ+4vsSuCPJom4T/0KCsE eV1DXWK4uLDsA1tFv6AwfJeAn6Zbyi5HcyDQU2agA0rlbrTFIrplujG6o1XZ+KYd /w4+ORbm1mnMIG0Cld+UolUqWOKZm5VdXkDlajgaorjHL/HtqVeX0oNRpeoRWKA= =Z6wC -----END PGP SIGNATURE----- --DEcGg5CflDsX4EnDKFUVue6dsN7jcaS03--