[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/30] qapi/schema: Clean up around QAPISchemaEntity.connect_d
From: |
Markus Armbruster |
Subject: |
[PATCH v2 11/30] qapi/schema: Clean up around QAPISchemaEntity.connect_doc() |
Date: |
Tue, 3 Mar 2020 17:34:46 +0100 |
QAPISchemaEntity calls doc.connect_feature() in .check(). Improper
since commit ee1e6a1f6c8 split .connect_doc() off .check(). Move the
call. Requires making the children call super().connect_doc() as they
should.
Signed-off-by: Markus Armbruster <address@hidden>
---
scripts/qapi/schema.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index cfbb9758c4..1c8d126441 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -53,13 +53,13 @@ class QAPISchemaEntity:
seen = {}
for f in self.features:
f.check_clash(self.info, seen)
- if self.doc:
- self.doc.connect_feature(f)
-
self._checked = True
def connect_doc(self, doc=None):
- pass
+ doc = doc or self.doc
+ if doc:
+ for f in self.features:
+ doc.connect_feature(f)
def check_doc(self):
if self.doc:
@@ -250,6 +250,7 @@ class QAPISchemaEnumType(QAPISchemaType):
m.check_clash(self.info, seen)
def connect_doc(self, doc=None):
+ super().connect_doc(doc)
doc = doc or self.doc
if doc:
for m in self.members:
@@ -392,6 +393,7 @@ class QAPISchemaObjectType(QAPISchemaType):
m.check_clash(info, seen)
def connect_doc(self, doc=None):
+ super().connect_doc(doc)
doc = doc or self.doc
if doc:
if self.base and self.base.is_implicit():
@@ -668,6 +670,7 @@ class QAPISchemaAlternateType(QAPISchemaType):
types_seen[qt] = v.name
def connect_doc(self, doc=None):
+ super().connect_doc(doc)
doc = doc or self.doc
if doc:
for v in self.variants.variants:
@@ -734,6 +737,7 @@ class QAPISchemaCommand(QAPISchemaEntity):
% self.ret_type.describe())
def connect_doc(self, doc=None):
+ super().connect_doc(doc)
doc = doc or self.doc
if doc:
if self.arg_type and self.arg_type.is_implicit():
@@ -776,6 +780,7 @@ class QAPISchemaEvent(QAPISchemaEntity):
% self.arg_type.describe())
def connect_doc(self, doc=None):
+ super().connect_doc(doc)
doc = doc or self.doc
if doc:
if self.arg_type and self.arg_type.is_implicit():
--
2.21.1
- [PATCH v2 00/30] Configurable policy for handling deprecated interfaces, Markus Armbruster, 2020/03/03
- [PATCH v2 02/30] qapi: Belatedly update doc comment for @wait deprecation, Markus Armbruster, 2020/03/03
- [PATCH v2 10/30] tests/test-qmp-event: Check event is actually emitted, Markus Armbruster, 2020/03/03
- [PATCH v2 09/30] tests/test-qmp-event: Use qobject_is_equal(), Markus Armbruster, 2020/03/03
- [PATCH v2 16/30] qapi/schema: Change _make_features() to a take feature list, Markus Armbruster, 2020/03/03
- [PATCH v2 19/30] qapi/schema: Call QAPIDoc.connect_member() in just one place, Markus Armbruster, 2020/03/03
- [PATCH v2 13/30] qapi: Consistently put @features parameter right after @ifcond, Markus Armbruster, 2020/03/03
- [PATCH v2 04/30] docs/devel/qapi-code-gen: Document 'features' introspection, Markus Armbruster, 2020/03/03
- [PATCH v2 05/30] tests/test-qmp-cmds: Factor out qmp_dispatch() test helpers, Markus Armbruster, 2020/03/03
- [PATCH v2 11/30] qapi/schema: Clean up around QAPISchemaEntity.connect_doc(),
Markus Armbruster <=
- [PATCH v2 24/30] qapi: Replace qmp_dispatch()'s TODO comment by an explanation, Markus Armbruster, 2020/03/03
- [PATCH v2 03/30] docs/devel/qapi-code-gen: Clarify allow-oob introspection, Markus Armbruster, 2020/03/03
- [PATCH v2 25/30] qapi: New special feature flag "deprecated", Markus Armbruster, 2020/03/03
- [PATCH v2 27/30] qemu-options: New -compat to set policy for deprecated interfaces, Markus Armbruster, 2020/03/03
- [PATCH v2 07/30] tests/test-qmp-cmds: Simplify test data setup, Markus Armbruster, 2020/03/03
- [PATCH v2 18/30] qapi/schema: Rename QAPISchemaObjectType{Variant, Variants}, Markus Armbruster, 2020/03/03
- [PATCH v2 08/30] tests/test-qmp-event: Simplify test data setup, Markus Armbruster, 2020/03/03
- [PATCH v2 01/30] qemu-doc: Belatedly document QMP command arg & result deprecation, Markus Armbruster, 2020/03/03
- [PATCH v2 22/30] qapi: Simplify how qmp_dispatch() deals with QCO_NO_SUCCESS_RESP, Markus Armbruster, 2020/03/03
- [PATCH v2 12/30] qapi: Add feature flags to remaining definitions, Markus Armbruster, 2020/03/03