[PATCH v1 2/9] qemu: capabilities: add static-recommended capability

Collin Walling posted 9 patches 1 year, 1 month ago
[PATCH v1 2/9] qemu: capabilities: add static-recommended capability
Posted by Collin Walling 1 year, 1 month ago
Check for the QEMU capability to query for a static-recommended CPU
model via CPU model expansion. Cache this capability for later.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
---
 src/qemu/qemu_capabilities.c                        | 2 ++
 src/qemu/qemu_capabilities.h                        | 1 +
 tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies | 6 +++++-
 tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml     | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 87412dd4ec..4ace8eea4a 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -697,6 +697,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
 
               /* 450 */
               "run-with.async-teardown", /* QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN */
+              "query-cpu-model-expansion.static-recommended", /* QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_STATIC_RECOMMENDED */
     );
 
 
@@ -1557,6 +1558,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
     { "object-add/arg-type/+iothread/thread-pool-max", QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX },
     { "query-migrate/ret-type/blocked-reasons", QEMU_CAPS_MIGRATION_BLOCKED_REASONS },
     { "screendump/arg-type/format/^png", QEMU_CAPS_SCREENSHOT_FORMAT_PNG },
+    { "query-cpu-model-expansion/arg-type/type/^static-recommended", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_STATIC_RECOMMENDED },
 };
 
 typedef struct _virQEMUCapsObjectTypeProps virQEMUCapsObjectTypeProps;
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e51d3fffdc..4fa64b6435 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -676,6 +676,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
 
     /* 450 */
     QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN, /* asynchronous teardown -run-with async-teardown=on|off */
+    QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_STATIC_RECOMMENDED, /* query-cpu-model-expansion supports type static-recommended*/
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
index 57ce64e88e..8cd7312bea 100644
--- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
@@ -15398,12 +15398,16 @@
         },
         {
           "name": "full"
+        },
+        {
+          "name": "static-recommended"
         }
       ],
       "meta-type": "enum",
       "values": [
         "static",
-        "full"
+        "full",
+        "static-recommended"
       ]
     },
     {
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
index 427ee9d5c7..0bb4233383 100644
--- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
@@ -112,6 +112,7 @@
   <flag name='rbd-encryption-layering'/>
   <flag name='rbd-encryption-luks-any'/>
   <flag name='run-with.async-teardown'/>
+  <flag name='query-cpu-model-expansion.static-recommended'/>
   <version>8000050</version>
   <microcodeVersion>39100245</microcodeVersion>
   <package>v8.0.0-1270-g1c12355b</package>
-- 
2.41.0
Re: [PATCH v1 2/9] qemu: capabilities: add static-recommended capability
Posted by Peter Krempa 1 year, 1 month ago
On Mon, Sep 11, 2023 at 17:07:09 -0400, Collin Walling wrote:
> Check for the QEMU capability to query for a static-recommended CPU
> model via CPU model expansion. Cache this capability for later.
> 
> Signed-off-by: Collin Walling <walling@linux.ibm.com>
> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
> ---
>  src/qemu/qemu_capabilities.c                        | 2 ++
>  src/qemu/qemu_capabilities.h                        | 1 +
>  tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies | 6 +++++-
>  tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml     | 1 +
>  4 files changed, 9 insertions(+), 1 deletion(-)

[...]

> diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
> index 57ce64e88e..8cd7312bea 100644
> --- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
> +++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
> @@ -15398,12 +15398,16 @@
>          },
>          {
>            "name": "full"
> +        },
> +        {
> +          "name": "static-recommended"
>          }
>        ],
>        "meta-type": "enum",
>        "values": [
>          "static",
> -        "full"
> +        "full",
> +        "static-recommended"

This is suspicious. We usually don't allow manual modification of the
file because it can be overwritten by a subsequent update of the file.

Could you please properly update the capability dump, by running
tests/qemucapsprobe /path/to/qemu-system-s390x >
/path/to/libvirt.git/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies

and commiting that to a separate commit. Ideally do this with the
released qemu-8.1, so that we have the most recent dump.
Re: [PATCH v1 2/9] qemu: capabilities: add static-recommended capability
Posted by Collin Walling 1 year ago
On 9/12/23 03:13, Peter Krempa wrote:
> On Mon, Sep 11, 2023 at 17:07:09 -0400, Collin Walling wrote:
>> Check for the QEMU capability to query for a static-recommended CPU
>> model via CPU model expansion. Cache this capability for later.
>>
>> Signed-off-by: Collin Walling <walling@linux.ibm.com>
>> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
>> ---
>>  src/qemu/qemu_capabilities.c                        | 2 ++
>>  src/qemu/qemu_capabilities.h                        | 1 +
>>  tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies | 6 +++++-
>>  tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml     | 1 +
>>  4 files changed, 9 insertions(+), 1 deletion(-)
> 
> [...]
> 
>> diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
>> index 57ce64e88e..8cd7312bea 100644
>> --- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
>> +++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
>> @@ -15398,12 +15398,16 @@
>>          },
>>          {
>>            "name": "full"
>> +        },
>> +        {
>> +          "name": "static-recommended"
>>          }
>>        ],
>>        "meta-type": "enum",
>>        "values": [
>>          "static",
>> -        "full"
>> +        "full",
>> +        "static-recommended"
> 
> This is suspicious. We usually don't allow manual modification of the
> file because it can be overwritten by a subsequent update of the file.
> 
> Could you please properly update the capability dump, by running
> tests/qemucapsprobe /path/to/qemu-system-s390x >
> /path/to/libvirt.git/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies
> 
> and commiting that to a separate commit. Ideally do this with the
> released qemu-8.1, so that we have the most recent dump.
> 

Understood. Thank you for the advice on how to generate the caps. I will
keep this noted for the future on next version and any future contributions.

-- 
Regards,
  Collin