qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v8 04/26] qapi: New QAPISchemaVisitor


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v8 04/26] qapi: New QAPISchemaVisitor
Date: Thu, 17 Sep 2015 09:46:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> 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 <address@hidden>
>> ---
>>  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 <address@hidden>

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]