[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 13/34] qapi: Consistently put @features parameter right af
From: |
Marc-André Lureau |
Subject: |
Re: [PATCH v3 13/34] qapi: Consistently put @features parameter right after @ifcond |
Date: |
Mon, 16 Mar 2020 17:52:53 +0100 |
On Sun, Mar 15, 2020 at 4:51 PM Markus Armbruster <address@hidden> wrote:
>
> Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
> ---
> scripts/qapi/commands.py | 6 +++---
> scripts/qapi/doc.py | 10 +++++-----
> scripts/qapi/introspect.py | 10 +++++-----
> scripts/qapi/schema.py | 36 ++++++++++++++++------------------
> scripts/qapi/types.py | 4 ++--
> scripts/qapi/visit.py | 4 ++--
> tests/qapi-schema/test-qapi.py | 10 +++++-----
> 7 files changed, 39 insertions(+), 41 deletions(-)
>
> diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
> index 0e13e82989..bc30876c88 100644
> --- a/scripts/qapi/commands.py
> +++ b/scripts/qapi/commands.py
> @@ -283,9 +283,9 @@ void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
> prefix=self._prefix))
> self._genc.add(gen_registry(self._regy.get_content(), self._prefix))
>
> - def visit_command(self, name, info, ifcond, arg_type, ret_type, gen,
> - success_response, boxed, allow_oob, allow_preconfig,
> - features):
> + def visit_command(self, name, info, ifcond, features,
> + arg_type, ret_type, gen, success_response, boxed,
> + allow_oob, allow_preconfig):
> if not gen:
> return
> # FIXME: If T is a user-defined type, the user is responsible
> diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
> index 36e823338b..92f584edcf 100644
> --- a/scripts/qapi/doc.py
> +++ b/scripts/qapi/doc.py
> @@ -249,8 +249,8 @@ class QAPISchemaGenDocVisitor(QAPISchemaVisitor):
> texi_members(doc, 'Values',
> member_func=texi_enum_value)))
>
> - def visit_object_type(self, name, info, ifcond, base, members, variants,
> - features):
> + def visit_object_type(self, name, info, ifcond, features,
> + base, members, variants):
> doc = self.cur_doc
> if base and base.is_implicit():
> base = None
> @@ -262,9 +262,9 @@ class QAPISchemaGenDocVisitor(QAPISchemaVisitor):
> self._gen.add(texi_type('Alternate', doc, ifcond,
> texi_members(doc, 'Members')))
>
> - def visit_command(self, name, info, ifcond, arg_type, ret_type, gen,
> - success_response, boxed, allow_oob, allow_preconfig,
> - features):
> + def visit_command(self, name, info, ifcond, features,
> + arg_type, ret_type, gen, success_response, boxed,
> + allow_oob, allow_preconfig):
> doc = self.cur_doc
> self._gen.add(texi_msg('Command', doc, ifcond,
> texi_arguments(doc,
> diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py
> index 2e9e00aa1f..b54910510d 100644
> --- a/scripts/qapi/introspect.py
> +++ b/scripts/qapi/introspect.py
> @@ -193,8 +193,8 @@ const QLitObject %(c_name)s = %(c_string)s;
> self._gen_qlit('[' + element + ']', 'array', {'element-type':
> element},
> ifcond, None)
>
> - def visit_object_type_flat(self, name, info, ifcond, members, variants,
> - features):
> + def visit_object_type_flat(self, name, info, ifcond, features,
> + members, variants):
> obj = {'members': [self._gen_member(m) for m in members]}
> if variants:
> obj.update(self._gen_variants(variants.tag_member.name,
> @@ -209,9 +209,9 @@ const QLitObject %(c_name)s = %(c_string)s;
> for m in variants.variants]},
> ifcond, features)
>
> - def visit_command(self, name, info, ifcond, arg_type, ret_type, gen,
> - success_response, boxed, allow_oob, allow_preconfig,
> - features):
> + def visit_command(self, name, info, ifcond, features,
> + arg_type, ret_type, gen, success_response, boxed,
> + allow_oob, allow_preconfig):
> arg_type = arg_type or self._schema.the_empty_object_type
> ret_type = ret_type or self._schema.the_empty_object_type
> obj = {'arg-type': self._use_type(arg_type),
> diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
> index 22238005ff..958756ecd6 100644
> --- a/scripts/qapi/schema.py
> +++ b/scripts/qapi/schema.py
> @@ -115,20 +115,20 @@ class QAPISchemaVisitor:
> def visit_array_type(self, name, info, ifcond, element_type):
> pass
>
> - def visit_object_type(self, name, info, ifcond, base, members, variants,
> - features):
> + def visit_object_type(self, name, info, ifcond, features,
> + base, members, variants):
> pass
>
> - def visit_object_type_flat(self, name, info, ifcond, members, variants,
> - features):
> + def visit_object_type_flat(self, name, info, ifcond, features,
> + members, variants):
> pass
>
> def visit_alternate_type(self, name, info, ifcond, features, variants):
> pass
>
> - def visit_command(self, name, info, ifcond, arg_type, ret_type, gen,
> - success_response, boxed, allow_oob, allow_preconfig,
> - features):
> + def visit_command(self, name, info, ifcond, features,
> + arg_type, ret_type, gen, success_response, boxed,
> + allow_oob, allow_preconfig):
> pass
>
> def visit_event(self, name, info, ifcond, features, arg_type, boxed):
> @@ -436,12 +436,12 @@ class QAPISchemaObjectType(QAPISchemaType):
>
> def visit(self, visitor):
> super().visit(visitor)
> - visitor.visit_object_type(self.name, self.info, self.ifcond,
> - self.base, self.local_members,
> self.variants,
> - self.features)
> - visitor.visit_object_type_flat(self.name, self.info, self.ifcond,
> - self.members, self.variants,
> - self.features)
> + visitor.visit_object_type(
> + self.name, self.info, self.ifcond, self.features,
> + self.base, self.local_members, self.variants)
> + visitor.visit_object_type_flat(
> + self.name, self.info, self.ifcond, self.features,
> + self.members, self.variants)
>
>
> class QAPISchemaMember:
> @@ -745,12 +745,10 @@ class QAPISchemaCommand(QAPISchemaEntity):
>
> def visit(self, visitor):
> super().visit(visitor)
> - visitor.visit_command(self.name, self.info, self.ifcond,
> - self.arg_type, self.ret_type,
> - self.gen, self.success_response,
> - self.boxed, self.allow_oob,
> - self.allow_preconfig,
> - self.features)
> + visitor.visit_command(
> + self.name, self.info, self.ifcond, self.features,
> + self.arg_type, self.ret_type, self.gen, self.success_response,
> + self.boxed, self.allow_oob, self.allow_preconfig)
>
>
> class QAPISchemaEvent(QAPISchemaEntity):
> diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
> index d0d5c03646..3ad33af4ee 100644
> --- a/scripts/qapi/types.py
> +++ b/scripts/qapi/types.py
> @@ -289,8 +289,8 @@ class QAPISchemaGenTypeVisitor(QAPISchemaModularCVisitor):
> self._genh.add(gen_array(name, element_type))
> self._gen_type_cleanup(name)
>
> - def visit_object_type(self, name, info, ifcond, base, members, variants,
> - features):
> + def visit_object_type(self, name, info, ifcond, features,
> + base, members, variants):
> # Nothing to do for the special empty builtin
> if name == 'q_empty':
> return
> diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
> index 6e5ed781d7..23d9194aa4 100644
> --- a/scripts/qapi/visit.py
> +++ b/scripts/qapi/visit.py
> @@ -326,8 +326,8 @@ class
> QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor):
> self._genh.add(gen_visit_decl(name))
> self._genc.add(gen_visit_list(name, element_type))
>
> - def visit_object_type(self, name, info, ifcond, base, members, variants,
> - features):
> + def visit_object_type(self, name, info, ifcond, features,
> + base, members, variants):
> # Nothing to do for the special empty builtin
> if name == 'q_empty':
> return
> diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
> index af5b57a0b1..8e09e54edb 100755
> --- a/tests/qapi-schema/test-qapi.py
> +++ b/tests/qapi-schema/test-qapi.py
> @@ -46,8 +46,8 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
> print('array %s %s' % (name, element_type.name))
> self._print_if(ifcond)
>
> - def visit_object_type(self, name, info, ifcond, base, members, variants,
> - features):
> + def visit_object_type(self, name, info, ifcond, features,
> + base, members, variants):
> print('object %s' % name)
> if base:
> print(' base %s' % base.name)
> @@ -65,9 +65,9 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
> self._print_if(ifcond)
> self._print_features(features)
>
> - def visit_command(self, name, info, ifcond, arg_type, ret_type, gen,
> - success_response, boxed, allow_oob, allow_preconfig,
> - features):
> + def visit_command(self, name, info, ifcond, features,
> + arg_type, ret_type, gen, success_response, boxed,
> + allow_oob, allow_preconfig):
> print('command %s %s -> %s'
> % (name, arg_type and arg_type.name,
> ret_type and ret_type.name))
> --
> 2.21.1
>
>
--
Marc-André Lureau
- Re: [PATCH v3 17/34] qapi/schema: Reorder classes so related ones are together, (continued)
- [PATCH v3 19/34] qapi/schema: Call QAPIDoc.connect_member() in just one place, Markus Armbruster, 2020/03/15
- [PATCH v3 22/34] qapi: Simplify how qmp_dispatch() deals with QCO_NO_SUCCESS_RESP, Markus Armbruster, 2020/03/15
- [PATCH v3 25/34] qapi: New special feature flag "deprecated", Markus Armbruster, 2020/03/15
- [PATCH v3 13/34] qapi: Consistently put @features parameter right after @ifcond, Markus Armbruster, 2020/03/15
- [PATCH v3 12/34] qapi: Add feature flags to remaining definitions, Markus Armbruster, 2020/03/15
- [PATCH v3 28/34] qapi: Implement deprecated-output=hide for QMP command results, Markus Armbruster, 2020/03/15
- [PATCH v3 26/34] qapi: Mark deprecated QMP parts with feature 'deprecated', Markus Armbruster, 2020/03/15
- [PATCH v3 29/34] qapi: Implement deprecated-output=hide for QMP events, Markus Armbruster, 2020/03/15