mirror of
https://github.com/mii443/qemu.git
synced 2025-12-07 21:18:22 +00:00
qapi: Add feature flags to remaining definitions
In v4.1.0, we added feature flags just to struct types (commit 6a8c0b5102^..f3ed93d545), to satisfy an immediate need (commitc9d4070991"file-posix: Add dynamic-auto-read-only QAPI feature"). In v4.2.0, we added them to commands (commit23394b4c39"qapi: Add feature flags to commands") to satisfy another immediate need (commit d76744e65e "qapi: Allow introspecting fix for savevm's cooperation with blockdev"). Add them to the remaining definitions: enumeration types, union types, alternate types, and events. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200317115459.31821-13-armbru@redhat.com>
This commit is contained in:
@@ -30,7 +30,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
||||
def visit_include(self, name, info):
|
||||
print('include %s' % name)
|
||||
|
||||
def visit_enum_type(self, name, info, ifcond, members, prefix):
|
||||
def visit_enum_type(self, name, info, ifcond, features, members, prefix):
|
||||
print('enum %s' % name)
|
||||
if prefix:
|
||||
print(' prefix %s' % prefix)
|
||||
@@ -38,6 +38,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
||||
print(' member %s' % m.name)
|
||||
self._print_if(m.ifcond, indent=8)
|
||||
self._print_if(ifcond)
|
||||
self._print_features(features)
|
||||
|
||||
def visit_array_type(self, name, info, ifcond, element_type):
|
||||
if not info:
|
||||
@@ -58,10 +59,11 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
||||
self._print_if(ifcond)
|
||||
self._print_features(features)
|
||||
|
||||
def visit_alternate_type(self, name, info, ifcond, variants):
|
||||
def visit_alternate_type(self, name, info, ifcond, features, variants):
|
||||
print('alternate %s' % name)
|
||||
self._print_variants(variants)
|
||||
self._print_if(ifcond)
|
||||
self._print_features(features)
|
||||
|
||||
def visit_command(self, name, info, ifcond, arg_type, ret_type, gen,
|
||||
success_response, boxed, allow_oob, allow_preconfig,
|
||||
@@ -74,10 +76,11 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
||||
self._print_if(ifcond)
|
||||
self._print_features(features)
|
||||
|
||||
def visit_event(self, name, info, ifcond, arg_type, boxed):
|
||||
def visit_event(self, name, info, ifcond, features, arg_type, boxed):
|
||||
print('event %s %s' % (name, arg_type and arg_type.name))
|
||||
print(' boxed=%s' % boxed)
|
||||
self._print_if(ifcond)
|
||||
self._print_features(features)
|
||||
|
||||
@staticmethod
|
||||
def _print_variants(variants):
|
||||
|
||||
Reference in New Issue
Block a user