[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/30] qapi/schema: Clean up around QAPISchemaEntity.connect_doc()
From: |
Markus Armbruster |
Subject: |
[PULL 12/30] qapi/schema: Clean up around QAPISchemaEntity.connect_doc() |
Date: |
Tue, 17 Mar 2020 22:00:57 +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>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <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 d759308b4e..2a2b495987 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():
@@ -667,6 +669,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:
@@ -733,6 +736,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():
@@ -775,6 +779,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
- [PULL 20/30] qapi/schema: Call QAPIDoc.connect_member() in just one place, (continued)
- [PULL 20/30] qapi/schema: Call QAPIDoc.connect_member() in just one place, Markus Armbruster, 2020/03/17
- [PULL 07/30] tests/test-qmp-cmds: Check responses more thoroughly, Markus Armbruster, 2020/03/17
- [PULL 10/30] tests/test-qmp-event: Use qobject_is_equal(), Markus Armbruster, 2020/03/17
- [PULL 04/30] docs/devel/qapi-code-gen: Clarify allow-oob introspection, Markus Armbruster, 2020/03/17
- [PULL 06/30] tests/test-qmp-cmds: Factor out qmp_dispatch() test helpers, Markus Armbruster, 2020/03/17
- [PULL 05/30] docs/devel/qapi-code-gen: Document 'features' introspection, Markus Armbruster, 2020/03/17
- [PULL 23/30] qapi: Simplify how qmp_dispatch() deals with QCO_NO_SUCCESS_RESP, Markus Armbruster, 2020/03/17
- [PULL 30/30] net: Track netdevs in NetClientState rather than QemuOpt, Markus Armbruster, 2020/03/17
- [PULL 08/30] tests/test-qmp-cmds: Simplify test data setup, Markus Armbruster, 2020/03/17
- [PULL 24/30] qapi: Simplify how qmp_dispatch() gets the request ID, Markus Armbruster, 2020/03/17
- [PULL 12/30] qapi/schema: Clean up around QAPISchemaEntity.connect_doc(),
Markus Armbruster <=
- [PULL 09/30] tests/test-qmp-event: Simplify test data setup, Markus Armbruster, 2020/03/17
- [PULL 28/30] qmp: constify QmpCommand and list, Markus Armbruster, 2020/03/17
- [PULL 14/30] qapi: Consistently put @features parameter right after @ifcond, Markus Armbruster, 2020/03/17
- [PULL 19/30] qapi/schema: Rename QAPISchemaObjectType{Variant, Variants}, Markus Armbruster, 2020/03/17
- [PULL 26/30] qapi: New special feature flag "deprecated", Markus Armbruster, 2020/03/17
- [PULL 27/30] qapi: Mark deprecated QMP parts with feature 'deprecated', Markus Armbruster, 2020/03/17
- [PULL 17/30] qapi/schema: Change _make_features() to a take feature list, Markus Armbruster, 2020/03/17
- [PULL 22/30] qapi: Inline do_qmp_dispatch() into qmp_dispatch(), Markus Armbruster, 2020/03/17
- [PULL 18/30] qapi/schema: Reorder classes so related ones are together, Markus Armbruster, 2020/03/17
- [PULL 29/30] net: Complete qapi-fication of netdev_add, Markus Armbruster, 2020/03/17