mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-27 12:02:04 -06:00
qapi: Add feature flags to struct members
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200317115459.31821-21-armbru@redhat.com>
This commit is contained in:
parent
645178c069
commit
84ab008687
11 changed files with 46 additions and 14 deletions
|
@ -55,6 +55,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
|||
print(' member %s: %s optional=%s'
|
||||
% (m.name, m.type.name, m.optional))
|
||||
self._print_if(m.ifcond, 8)
|
||||
self._print_features(m.features, indent=8)
|
||||
self._print_variants(variants)
|
||||
self._print_if(ifcond)
|
||||
self._print_features(features)
|
||||
|
@ -96,11 +97,11 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
|||
print('%sif %s' % (' ' * indent, ifcond))
|
||||
|
||||
@classmethod
|
||||
def _print_features(cls, features):
|
||||
def _print_features(cls, features, indent=4):
|
||||
if features:
|
||||
for f in features:
|
||||
print(' feature %s' % f.name)
|
||||
cls._print_if(f.ifcond, 8)
|
||||
print('%sfeature %s' % (' ' * indent, f.name))
|
||||
cls._print_if(f.ifcond, indent + 4)
|
||||
|
||||
|
||||
def test_frontend(fname):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue