[libvirt PATCH] cpu-data.py: Query hyperv enlightenments

Tim Wiederhake posted 1 patch 2 years, 2 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220127135128.16569-1-twiederh@redhat.com
tests/cputestdata/cpu-data.py | 7 +++++++
1 file changed, 7 insertions(+)
[libvirt PATCH] cpu-data.py: Query hyperv enlightenments
Posted by Tim Wiederhake 2 years, 2 months ago
Reporting hv-* properties properly requires hv to be enabled,
see qemu commit 071ce4b03b.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
---
 tests/cputestdata/cpu-data.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/cputestdata/cpu-data.py b/tests/cputestdata/cpu-data.py
index d8a89ebc2a..0200db7a78 100755
--- a/tests/cputestdata/cpu-data.py
+++ b/tests/cputestdata/cpu-data.py
@@ -216,12 +216,19 @@ def gather_model(args):
             "id": "model-expansion"
         }])
 
+    version = 0, 0
     static_model = None
     for o in output:
         if o.get("id") == "model-expansion":
             static_model = o["return"]["model"]
+        if "QMP" in o:
+            version = o["QMP"]["version"]["qemu"]
+            version = version["major"], version["minor"]
 
     if static_model:
+        if version[0] > 6 or (version[0] == 6 and version[1] >= 1):
+            static_model["props"]["hv-passthrough"] = True
+
         return call_qemu(args.path_to_qemu, [
             {
                 "execute": "query-cpu-model-expansion",
-- 
2.31.1

Re: [libvirt PATCH] cpu-data.py: Query hyperv enlightenments
Posted by Michal Prívozník 2 years, 2 months ago
On 1/27/22 14:51, Tim Wiederhake wrote:
> Reporting hv-* properties properly requires hv to be enabled,
> see qemu commit 071ce4b03b.
> 
> Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
> ---
>  tests/cputestdata/cpu-data.py | 7 +++++++
>  1 file changed, 7 insertions(+)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal