[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 7/9] qapi: convert 'if' C-expressions to the new syntax tree
From: |
marcandre . lureau |
Subject: |
[PATCH v4 7/9] qapi: convert 'if' C-expressions to the new syntax tree |
Date: |
Mon, 17 May 2021 20:30:38 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: John Snow <jsnow@redhat.com>
---
qapi/machine-target.json | 20 ++++++++++++++++----
qapi/misc-target.json | 12 +++++++++++-
2 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/qapi/machine-target.json b/qapi/machine-target.json
index e7811654b7..9b56b81bea 100644
--- a/qapi/machine-target.json
+++ b/qapi/machine-target.json
@@ -213,7 +213,9 @@
##
{ 'struct': 'CpuModelExpansionInfo',
'data': { 'model': 'CpuModelInfo' },
- 'if': 'defined(TARGET_S390X) || defined(TARGET_I386) || defined(TARGET_ARM)'
}
+ 'if': { 'any': [ 'defined(TARGET_S390X)',
+ 'defined(TARGET_I386)',
+ 'defined(TARGET_ARM)'] } }
##
# @query-cpu-model-expansion:
@@ -252,7 +254,9 @@
'data': { 'type': 'CpuModelExpansionType',
'model': 'CpuModelInfo' },
'returns': 'CpuModelExpansionInfo',
- 'if': 'defined(TARGET_S390X) || defined(TARGET_I386) || defined(TARGET_ARM)'
}
+ 'if': { 'any': [ 'defined(TARGET_S390X)',
+ 'defined(TARGET_I386)',
+ 'defined(TARGET_ARM)' ] } }
##
# @CpuDefinitionInfo:
@@ -316,7 +320,11 @@
'typename': 'str',
'*alias-of' : 'str',
'deprecated' : 'bool' },
- 'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) ||
defined(TARGET_S390X) || defined(TARGET_MIPS)' }
+ 'if': { 'any': [ 'defined(TARGET_PPC)',
+ 'defined(TARGET_ARM)',
+ 'defined(TARGET_I386)',
+ 'defined(TARGET_S390X)',
+ 'defined(TARGET_MIPS)' ] } }
##
# @query-cpu-definitions:
@@ -328,4 +336,8 @@
# Since: 1.2
##
{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'],
- 'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) ||
defined(TARGET_S390X) || defined(TARGET_MIPS)' }
+ 'if': { 'any': [ 'defined(TARGET_PPC)',
+ 'defined(TARGET_ARM)',
+ 'defined(TARGET_I386)',
+ 'defined(TARGET_S390X)',
+ 'defined(TARGET_MIPS)' ] } }
diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index 6200c671be..835a74a072 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -23,7 +23,17 @@
##
{ 'event': 'RTC_CHANGE',
'data': { 'offset': 'int' },
- 'if': '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': [ '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)' ] } }
##
# @rtc-reset-reinjection:
--
2.29.0
- [PATCH v4 0/9] qapi: untie 'if' conditions from C preprocessor, marcandre . lureau, 2021/05/17
- [PATCH v4 1/9] qapi: replace List[str] by QAPISchemaIfCond, marcandre . lureau, 2021/05/17
- [PATCH v4 2/9] qapi: make gen_if/gen_endif take a simple string, marcandre . lureau, 2021/05/17
- [PATCH v4 3/9] qapi: start building an 'if' predicate tree, marcandre . lureau, 2021/05/17
- [PATCH v4 4/9] qapi: introduce IfPredicateList and IfAny, marcandre . lureau, 2021/05/17
- [PATCH v4 5/9] qapi: add IfNot, marcandre . lureau, 2021/05/17
- [PATCH v4 6/9] qapi: normalize 'if' condition to IfPredicate tree, marcandre . lureau, 2021/05/17
- [PATCH v4 7/9] qapi: convert 'if' C-expressions to the new syntax tree,
marcandre . lureau <=
- [PATCH v4 9/9] docs: update the documentation about schema configuration, marcandre . lureau, 2021/05/17
- [PATCH v4 8/9] qapi: make 'if' condition strings simple identifiers, marcandre . lureau, 2021/05/17
- Re: [PATCH v4 0/9] qapi: untie 'if' conditions from C preprocessor, Markus Armbruster, 2021/05/21