Przeglądaj źródła

qapi: Consistently put @features parameter right after @ifcond

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200317115459.31821-14-armbru@redhat.com>
Markus Armbruster 5 lat temu
rodzic
commit
7b3bc9e28f

+ 3 - 3
scripts/qapi/commands.py

@@ -283,9 +283,9 @@ def visit_end(self):
                                       prefix=self._prefix))
                                       prefix=self._prefix))
         self._genc.add(gen_registry(self._regy.get_content(), 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:
         if not gen:
             return
             return
         # FIXME: If T is a user-defined type, the user is responsible
         # FIXME: If T is a user-defined type, the user is responsible

+ 5 - 5
scripts/qapi/doc.py

@@ -249,8 +249,8 @@ def visit_enum_type(self, name, info, ifcond, features, members, prefix):
                                 texi_members(doc, 'Values',
                                 texi_members(doc, 'Values',
                                              member_func=texi_enum_value)))
                                              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
         doc = self.cur_doc
         if base and base.is_implicit():
         if base and base.is_implicit():
             base = None
             base = None
@@ -262,9 +262,9 @@ def visit_alternate_type(self, name, info, ifcond, features, variants):
         self._gen.add(texi_type('Alternate', doc, ifcond,
         self._gen.add(texi_type('Alternate', doc, ifcond,
                                 texi_members(doc, 'Members')))
                                 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
         doc = self.cur_doc
         self._gen.add(texi_msg('Command', doc, ifcond,
         self._gen.add(texi_msg('Command', doc, ifcond,
                                texi_arguments(doc,
                                texi_arguments(doc,

+ 5 - 5
scripts/qapi/introspect.py

@@ -193,8 +193,8 @@ def visit_array_type(self, name, info, ifcond, element_type):
         self._gen_qlit('[' + element + ']', 'array', {'element-type': element},
         self._gen_qlit('[' + element + ']', 'array', {'element-type': element},
                        ifcond, None)
                        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]}
         obj = {'members': [self._gen_member(m) for m in members]}
         if variants:
         if variants:
             obj.update(self._gen_variants(variants.tag_member.name,
             obj.update(self._gen_variants(variants.tag_member.name,
@@ -209,9 +209,9 @@ def visit_alternate_type(self, name, info, ifcond, features, variants):
                            for m in variants.variants]},
                            for m in variants.variants]},
                        ifcond, features)
                        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
         arg_type = arg_type or self._schema.the_empty_object_type
         ret_type = ret_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),
         obj = {'arg-type': self._use_type(arg_type),

+ 17 - 19
scripts/qapi/schema.py

@@ -115,20 +115,20 @@ def visit_enum_type(self, name, info, ifcond, features, members, prefix):
     def visit_array_type(self, name, info, ifcond, element_type):
     def visit_array_type(self, name, info, ifcond, element_type):
         pass
         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
         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
         pass
 
 
     def visit_alternate_type(self, name, info, ifcond, features, variants):
     def visit_alternate_type(self, name, info, ifcond, features, variants):
         pass
         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
         pass
 
 
     def visit_event(self, name, info, ifcond, features, arg_type, boxed):
     def visit_event(self, name, info, ifcond, features, arg_type, boxed):
@@ -436,12 +436,12 @@ def json_type(self):
 
 
     def visit(self, visitor):
     def visit(self, visitor):
         super().visit(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:
 class QAPISchemaMember:
@@ -745,12 +745,10 @@ def connect_doc(self, doc=None):
 
 
     def visit(self, visitor):
     def visit(self, visitor):
         super().visit(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):
 class QAPISchemaEvent(QAPISchemaEntity):

+ 2 - 2
scripts/qapi/types.py

@@ -289,8 +289,8 @@ def visit_array_type(self, name, info, ifcond, element_type):
             self._genh.add(gen_array(name, element_type))
             self._genh.add(gen_array(name, element_type))
             self._gen_type_cleanup(name)
             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
         # Nothing to do for the special empty builtin
         if name == 'q_empty':
         if name == 'q_empty':
             return
             return

+ 2 - 2
scripts/qapi/visit.py

@@ -326,8 +326,8 @@ def visit_array_type(self, name, info, ifcond, element_type):
             self._genh.add(gen_visit_decl(name))
             self._genh.add(gen_visit_decl(name))
             self._genc.add(gen_visit_list(name, element_type))
             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
         # Nothing to do for the special empty builtin
         if name == 'q_empty':
         if name == 'q_empty':
             return
             return

+ 5 - 5
tests/qapi-schema/test-qapi.py

@@ -46,8 +46,8 @@ def visit_array_type(self, name, info, ifcond, element_type):
         print('array %s %s' % (name, element_type.name))
         print('array %s %s' % (name, element_type.name))
         self._print_if(ifcond)
         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)
         print('object %s' % name)
         if base:
         if base:
             print('    base %s' % base.name)
             print('    base %s' % base.name)
@@ -65,9 +65,9 @@ def visit_alternate_type(self, name, info, ifcond, features, variants):
         self._print_if(ifcond)
         self._print_if(ifcond)
         self._print_features(features)
         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'
         print('command %s %s -> %s'
               % (name, arg_type and arg_type.name,
               % (name, arg_type and arg_type.name,
                  ret_type and ret_type.name))
                  ret_type and ret_type.name))