qapi: make 'if' condition strings simple identifiers

Change the 'if' condition strings to be C-agnostic. It will accept
'[A-Z][A-Z0-9_]*' identifiers. This allows to express configuration
conditions in other languages (Rust or Python for ex) or other more
suitable forms.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: John Snow <jsnow@redhat.com>
Message-Id: <20210804083105.97531-11-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Rebased with semantic conflict in redefined-event.json]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Marc-André Lureau 2021-08-04 12:31:05 +04:00 committed by Markus Armbruster
parent 2b7d214536
commit 8a9f1e1d9c
25 changed files with 206 additions and 208 deletions

View file

@ -23,17 +23,17 @@
##
{ 'event': 'RTC_CHANGE',
'data': { 'offset': 'int' },
'if': { 'any': [ 'defined(TARGET_ALPHA)',
'defined(TARGET_ARM)',
'defined(TARGET_HPPA)',
'defined(TARGET_I386)',
'defined(TARGET_MIPS)',
'defined(TARGET_MIPS64)',
'defined(TARGET_PPC)',
'defined(TARGET_PPC64)',
'defined(TARGET_S390X)',
'defined(TARGET_SH4)',
'defined(TARGET_SPARC)' ] } }
'if': { 'any': [ 'TARGET_ALPHA',
'TARGET_ARM',
'TARGET_HPPA',
'TARGET_I386',
'TARGET_MIPS',
'TARGET_MIPS64',
'TARGET_PPC',
'TARGET_PPC64',
'TARGET_S390X',
'TARGET_SH4',
'TARGET_SPARC' ] } }
##
# @rtc-reset-reinjection:
@ -52,7 +52,7 @@
#
##
{ 'command': 'rtc-reset-reinjection',
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
@ -79,7 +79,7 @@
{ 'enum': 'SevState',
'data': ['uninit', 'launch-update', 'launch-secret', 'running',
'send-update', 'receive-update' ],
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
# @SevInfo:
@ -111,7 +111,7 @@
'state' : 'SevState',
'handle' : 'uint32'
},
'if': 'defined(TARGET_I386)'
'if': 'TARGET_I386'
}
##
@ -132,7 +132,7 @@
#
##
{ 'command': 'query-sev', 'returns': 'SevInfo',
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
@ -146,7 +146,7 @@
#
##
{ 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'},
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
# @query-sev-launch-measure:
@ -164,7 +164,7 @@
#
##
{ 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo',
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
@ -189,7 +189,7 @@
'cert-chain': 'str',
'cbitpos': 'int',
'reduced-phys-bits': 'int'},
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
# @query-sev-capabilities:
@ -209,7 +209,7 @@
#
##
{ 'command': 'query-sev-capabilities', 'returns': 'SevCapability',
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
# @sev-inject-launch-secret:
@ -227,7 +227,7 @@
##
{ 'command': 'sev-inject-launch-secret',
'data': { 'packet-header': 'str', 'secret': 'str', '*gpa': 'uint64' },
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
# @dump-skeys:
@ -249,7 +249,7 @@
##
{ 'command': 'dump-skeys',
'data': { 'filename': 'str' },
'if': 'defined(TARGET_S390X)' }
'if': 'TARGET_S390X' }
##
# @GICCapability:
@ -274,7 +274,7 @@
'data': { 'version': 'int',
'emulated': 'bool',
'kernel': 'bool' },
'if': 'defined(TARGET_ARM)' }
'if': 'TARGET_ARM' }
##
# @query-gic-capabilities:
@ -294,7 +294,7 @@
#
##
{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'],
'if': 'defined(TARGET_ARM)' }
'if': 'TARGET_ARM' }
##
@ -310,7 +310,7 @@
##
{ 'struct': 'SevAttestationReport',
'data': { 'data': 'str'},
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }
##
# @query-sev-attestation-report:
@ -332,4 +332,4 @@
##
{ 'command': 'query-sev-attestation-report', 'data': { 'mnonce': 'str' },
'returns': 'SevAttestationReport',
'if': 'defined(TARGET_I386)' }
'if': 'TARGET_I386' }