]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu-gather: Move full model extraction to new script
authorTim Wiederhake <twiederh@redhat.com>
Tue, 15 Dec 2020 16:24:58 +0000 (17:24 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 18 Dec 2020 22:20:11 +0000 (23:20 +0100)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/cputestdata/cpu-gather.py
tests/cputestdata/cpu-gather.sh

index 5c03d226b6467ea60f2bd4f3ee5bf38bdd77a431..ea1d42f1ec1533f1a1aba36d70a79ce8df2169c3 100755 (executable)
@@ -117,7 +117,21 @@ def gather_static_model(args):
 
 def gather_full_model(args, static_model):
     if static_model:
-        return []
+        return call_qemu(args.path_to_qemu, [
+            {
+                "execute": "query-cpu-model-expansion",
+                "arguments":
+                {
+                    "type": "full",
+                    "model": static_model
+                },
+                "id": "model-expansion"
+            },
+            {
+                "execute": "query-cpu-definitions",
+                "id": "definitions"
+            }
+        ])
     else:
         return call_qemu(args.path_to_qemu, [
             {
index 05faf14a96d8b872e47acae5103dd7abc45a3b34..5cef26c8e626b2e33154054d68a1c3867248b500 100755 (executable)
@@ -4,23 +4,3 @@ if [ -z "${CPU_GATHER_PY}" ]; then
     echo >&2 "Do not call this script directly. Use 'cpu-gather.py' instead."
     exit 1
 fi
-
-model_expansion()
-{
-    mode=$1
-    model=$2
-
-    echo '{"execute":"query-cpu-model-expansion","arguments":' \
-         '{"type":"'"$mode"'","model":'"$model"'},"id":"model-expansion"}'
-}
-
-$qemu -machine accel=kvm -cpu host -nodefaults -nographic -qmp stdio <<EOF
-{"execute":"qmp_capabilities"}
-$(
-    if [ "x$model" != x ]; then
-        model_expansion full "$model"
-    fi
-)
-{"execute":"query-cpu-definitions","id":"definitions"}
-{"execute":"quit"}
-EOF