mirror of
https://github.com/mii443/qemu.git
synced 2025-08-30 19:09:35 +00:00
qapi: Don't use info as witness of implicit object type
A future patch will enable error reporting from the various QAPISchema*.check() methods. But to report an error related to an implicit type, we'll need to associate a location with the type (the same location as the top-level entity that is causing the creation of the implicit type), and once we do that, keying off of whether foo.info exists is no longer a viable way to determine if foo is an implicit type. Instead, add an is_implicit() method to QAPISchemaEntity, and use it. It can be overridden later for ObjectType and EnumType, when implicit instances of those classes gain info. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1444710158-8723-8-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
committed by
Markus Armbruster
parent
849ab13c16
commit
49823c4b43
@ -337,7 +337,8 @@ class QAPISchemaGenVisitVisitor(QAPISchemaVisitor):
|
||||
|
||||
def visit_needed(self, entity):
|
||||
# Visit everything except implicit objects
|
||||
return not isinstance(entity, QAPISchemaObjectType) or entity.info
|
||||
return not (entity.is_implicit() and
|
||||
isinstance(entity, QAPISchemaObjectType))
|
||||
|
||||
def visit_enum_type(self, name, info, values, prefix):
|
||||
self.decl += gen_visit_decl(name, scalar=True)
|
||||
|
Reference in New Issue
Block a user