qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC v3 04/32] qapi: New QAPISchemaVisitor


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v3 04/32] qapi: New QAPISchemaVisitor
Date: Tue, 4 Aug 2015 16:26:33 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---
>  scripts/qapi.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
> 
> 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)
>  
> +    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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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