[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 09/10] qapi: add 'not' condition operation
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH v7 09/10] qapi: add 'not' condition operation |
|
Date: |
Fri, 06 Aug 2021 08:52:56 +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>
>
> For the sake of completeness, introduce the 'not' condition.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
[...]
> diff --git a/tests/qapi-schema/enum-if-invalid.err
> b/tests/qapi-schema/enum-if-invalid.err
> index b96d94c48a..3bb84075a9 100644
> --- a/tests/qapi-schema/enum-if-invalid.err
> +++ b/tests/qapi-schema/enum-if-invalid.err
> @@ -1,3 +1,3 @@
> enum-if-invalid.json: In enum 'TestIfEnum':
> enum-if-invalid.json:2: 'if' condition has unknown key 'val'
> -Valid keys are 'all', 'any'.
> +Valid keys are 'all', 'any', 'not'.
> diff --git a/tests/qapi-schema/qapi-schema-test.json
> b/tests/qapi-schema/qapi-schema-test.json
> index 5e3dbc0f72..1b3311ce89 100644
> --- a/tests/qapi-schema/qapi-schema-test.json
> +++ b/tests/qapi-schema/qapi-schema-test.json
> @@ -244,7 +244,7 @@
> 'if': { 'all': ['defined(TEST_IF_ALT)', 'defined(TEST_IF_STRUCT)'] } }
>
> { 'command': 'test-if-alternate-cmd', 'data': { 'alt-cmd-arg':
> 'TestIfAlternate' },
> - 'if': { 'all': ['defined(TEST_IF_ALT)'] } }
> + 'if': { 'all': ['defined(TEST_IF_ALT)', {'not':
> 'defined(TEST_IF_NOT_ALT)'}] } }
Easier to read:
{ 'command': 'test-if-alternate-cmd',
'data': { 'alt-cmd-arg': 'TestIfAlternate' },
'if': { 'all': ['defined(TEST_IF_ALT)',
{'not': 'defined(TEST_IF_NOT_ALT)'}] } }
Done in my tree.
>
> { 'command': 'test-if-cmd',
> 'data': {
[...]