mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-21 06:58:36 -07:00
qapi: add 'if' to union members
Add 'if' key to union members:
{ 'union': 'TestIfUnion', 'data':
'mem': { 'type': 'str', 'if': 'COND'} }
The generated code remains unconditional for now. Later patches
generate the conditionals.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20181213123724.4866-16-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
ccadd6bcba
commit
a2724280fb
5 changed files with 17 additions and 9 deletions
|
|
@ -68,6 +68,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
|||
print(' tag %s' % variants.tag_member.name)
|
||||
for v in variants.variants:
|
||||
print(' case %s: %s' % (v.name, v.type.name))
|
||||
QAPISchemaTestVisitor._print_if(v.ifcond, indent=8)
|
||||
|
||||
@staticmethod
|
||||
def _print_if(ifcond, indent=4):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue