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

@@ -342,7 +342,7 @@
{ 'struct': 'ChardevSpiceChannel',
'data': { 'type': 'str' },
'base': 'ChardevCommon',
'if': 'defined(CONFIG_SPICE)' }
'if': 'CONFIG_SPICE' }
##
# @ChardevSpicePort:
@@ -356,7 +356,7 @@
{ 'struct': 'ChardevSpicePort',
'data': { 'fqdn': 'str' },
'base': 'ChardevCommon',
'if': 'defined(CONFIG_SPICE)' }
'if': 'CONFIG_SPICE' }
##
# @ChardevVC:
@@ -405,7 +405,7 @@
'data': { '*mouse': 'bool',
'*clipboard': 'bool' },
'base': 'ChardevCommon',
'if': 'defined(CONFIG_SPICE_PROTOCOL)' }
'if': 'CONFIG_SPICE_PROTOCOL' }
##
# @ChardevBackend:
@@ -431,11 +431,11 @@
'stdio': 'ChardevStdio',
'console': 'ChardevCommon',
'spicevmc': { 'type': 'ChardevSpiceChannel',
'if': 'defined(CONFIG_SPICE)' },
'if': 'CONFIG_SPICE' },
'spiceport': { 'type': 'ChardevSpicePort',
'if': 'defined(CONFIG_SPICE)' },
'if': 'CONFIG_SPICE' },
'qemu-vdagent': { 'type': 'ChardevQemuVDAgent',
'if': 'defined(CONFIG_SPICE_PROTOCOL)' },
'if': 'CONFIG_SPICE_PROTOCOL' },
'vc': 'ChardevVC',
'ringbuf': 'ChardevRingbuf',
# next one is just for compatibility