]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu-data.py: Query hyperv enlightenments
authorTim Wiederhake <twiederh@redhat.com>
Tue, 25 Jan 2022 11:18:23 +0000 (12:18 +0100)
committerTim Wiederhake <twiederh@redhat.com>
Fri, 28 Jan 2022 09:55:03 +0000 (10:55 +0100)
Reporting hv-* properties properly requires hv to be enabled,
see qemu commit 071ce4b03b.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/cputestdata/cpu-data.py

index d8a89ebc2a9c22ad323f2ad49be76182a3883052..0200db7a78fca7d0ff2391cf6f59ad2e24a4e20a 100755 (executable)
@@ -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",