[PATCH 1/3] qapi: Make @associativity, @policy and @line of NumaHmatCacheOptions optional

Michal Privoznik posted 3 patches 5 years, 8 months ago
Maintainers: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>
[PATCH 1/3] qapi: Make @associativity, @policy and @line of NumaHmatCacheOptions optional
Posted by Michal Privoznik 5 years, 8 months ago
The documentation to `-numa hmat-cache` says that @node-id, @size
and @level are the only required attributes. The rest
(@associativity, @policy and @line) is optional. Well, not quite
- if I try to start QEMU with only the three required attributes
defined the QAPI code is complaining about associativity missing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 qapi/machine.json | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/qapi/machine.json b/qapi/machine.json
index ff7b5032e3..952784f8ba 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -723,9 +723,9 @@
    'node-id': 'uint32',
    'size': 'size',
    'level': 'uint8',
-   'associativity': 'HmatCacheAssociativity',
-   'policy': 'HmatCacheWritePolicy',
-   'line': 'uint16' }}
+   '*associativity': 'HmatCacheAssociativity',
+   '*policy': 'HmatCacheWritePolicy',
+   '*line': 'uint16' }}
 
 ##
 # @HostMemPolicy:
-- 
2.26.2


Re: [PATCH 1/3] qapi: Make @associativity, @policy and @line of NumaHmatCacheOptions optional
Posted by Igor Mammedov 5 years, 8 months ago
On Fri, 29 May 2020 15:33:46 +0200
Michal Privoznik <mprivozn@redhat.com> wrote:

> The documentation to `-numa hmat-cache` says that @node-id, @size
> and @level are the only required attributes. The rest
> (@associativity, @policy and @line) is optional. Well, not quite
> - if I try to start QEMU with only the three required attributes
> defined the QAPI code is complaining about associativity missing.

indeed, they are marked as optional CLI arguments but we don't have
a code that would make them as optional. And I'd prefer docs fixed
instead of introducing default values handling here.


> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  qapi/machine.json | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/qapi/machine.json b/qapi/machine.json
> index ff7b5032e3..952784f8ba 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -723,9 +723,9 @@
>     'node-id': 'uint32',
>     'size': 'size',
>     'level': 'uint8',
> -   'associativity': 'HmatCacheAssociativity',
> -   'policy': 'HmatCacheWritePolicy',
> -   'line': 'uint16' }}
> +   '*associativity': 'HmatCacheAssociativity',
> +   '*policy': 'HmatCacheWritePolicy',
> +   '*line': 'uint16' }}
>  
>  ##
>  # @HostMemPolicy: