Received: from eggs.gnu.org ([2001:4830:134:3::10]:48314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcTtl-00072m-Mm for qemu-devel@nongnu.org; Thu, 17 Sep 2015 03:46:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcTtg-0003EA-8s for qemu-devel@nongnu.org; Thu, 17 Sep 2015 03:46:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcTtg-0003E3-3w for qemu-devel@nongnu.org; Thu, 17 Sep 2015 03:46:24 -0400 From: Markus Armbruster References: <1442401589-24189-1-git-send-email-armbru@redhat.com> <1442401589-24189-5-git-send-email-armbru@redhat.com> <55F98917.3010009@redhat.com> Date: Thu, 17 Sep 2015 09:46:21 +0200 In-Reply-To: <55F98917.3010009@redhat.com> (Eric Blake's message of "Wed, 16 Sep 2015 09:21:59 -0600") Message-ID: <87oah1fpyq.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v8 04/26] qapi: New QAPISchemaVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > 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. >> >> Signed-off-by: Markus Armbruster >> --- >> scripts/qapi.py | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 64 insertions(+) >> > >> @@ -840,6 +876,10 @@ class QAPISchemaEnumType(QAPISchemaType): >> def json_type(self): >> return 'string' >> >> + 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(). Could be explored on top. We need to wrap up this series. > 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 Thanks!