[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 08/10] qapi: Use 'if': { 'any': ... } where appropriate
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v7 08/10] qapi: Use 'if': { 'any': ... } where appropriate |
Date: |
Thu, 05 Aug 2021 15:56:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
marcandre.lureau@redhat.com writes:
> 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>
> Reviewed-by: Markus Armbruster <armbru@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 5573dcf8f0..9e2ea4a04a 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:
Missing:
diff --git a/qapi/ui.json b/qapi/ui.json
index fd9677d48e..aed2bec4ab 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1136,7 +1136,8 @@
{ 'name': 'gtk', 'if': 'defined(CONFIG_GTK)' },
{ 'name': 'sdl', 'if': 'defined(CONFIG_SDL)' },
{ 'name': 'egl-headless',
- 'if': 'defined(CONFIG_OPENGL) && defined(CONFIG_GBM)' },
+ 'if': { 'all': [ 'defined(CONFIG_OPENGL)',
+ 'defined(CONFIG_GBM)' ] } },
{ 'name': 'curses', 'if': 'defined(CONFIG_CURSES)' },
{ 'name': 'cocoa', 'if': 'defined(CONFIG_COCOA)' },
{ 'name': 'spice-app', 'if': 'defined(CONFIG_SPICE)'} ] }
@@ -1167,7 +1168,8 @@
'gtk': { 'type': 'DisplayGTK', 'if': 'defined(CONFIG_GTK)' },
'curses': { 'type': 'DisplayCurses', 'if': 'defined(CONFIG_CURSES)' },
'egl-headless': { 'type': 'DisplayEGLHeadless',
- 'if': 'defined(CONFIG_OPENGL) &&
defined(CONFIG_GBM)' }
+ 'if': { 'all': [ 'defined(CONFIG_OPENGL)',
+ 'defined(CONFIG_GBM)' ] } }
}
}
You make up for it in PATCH 10. Can tidy up in my tree.
- Re: [PATCH v7 05/10] qapidoc: introduce QAPISchemaIfCond.docgen(), (continued)
[PATCH v7 06/10] qapi: replace if condition list with dict {'all': [...]}, marcandre . lureau, 2021/08/04
[PATCH v7 07/10] qapi: add 'any' condition, marcandre . lureau, 2021/08/04
[PATCH v7 08/10] qapi: Use 'if': { 'any': ... } where appropriate, marcandre . lureau, 2021/08/04
- Re: [PATCH v7 08/10] qapi: Use 'if': { 'any': ... } where appropriate,
Markus Armbruster <=
[PATCH v7 09/10] qapi: add 'not' condition operation, marcandre . lureau, 2021/08/04
[PATCH v7 10/10] qapi: make 'if' condition strings simple identifiers, marcandre . lureau, 2021/08/04
Re: [PATCH v7 00/10] qapi: untie 'if' conditions from C preprocessor, Markus Armbruster, 2021/08/05