diff options
Diffstat (limited to 'scripts/qapi-introspect.py')
-rw-r--r-- | scripts/qapi-introspect.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py index 7d39320174..c0dad6679c 100644 --- a/scripts/qapi-introspect.py +++ b/scripts/qapi-introspect.py @@ -54,7 +54,6 @@ class QAPISchemaGenIntrospectVisitor(QAPISchemaVisitor): self._jsons = [] self._used_types = [] self._name_map = {} - return QAPISchemaType # don't visit types for now def visit_end(self): # visit the types that are actually used @@ -82,6 +81,10 @@ const char %(c_name)s[] = %(c_string)s; self._used_types = None self._name_map = None + def visit_needed(self, entity): + # Ignore types on first pass; visit_end() will pick up used types + return not isinstance(entity, QAPISchemaType) + def _name(self, name): if self._unmask: return name |