]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: convert x86_64 tests to query-cpus-fast
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Aug 2022 15:15:05 +0000 (17:15 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 8 Aug 2022 15:36:49 +0000 (17:36 +0200)
All supported versions of QEMU include the query-cpus-fast QMP command.
In preparation for dropping support for the old "query-cpus" commands,
convert the JSON output for x86 tests to the new format, and drop the
"halted" field from the expected output as it is not available anymore.

The CPU properties were obtained from the query-hotpluggable-cpus output
in tests/qemumonitorjsondata.  CPU, thread_id, and qom_path are renamed
respectively to cpu-index, qom-path and thread-id, while nip and halted
are removed.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable-cpus.json
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-basic-pluggable.data
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full-cpus.json
tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-node-full.data
tests/qemumonitorjsontest.c

index 7a4973195c3f4dc1698bcb1e26a10060e91f2151..c4250dae1d3553858b72d174eacb6810461e6d1a 100644 (file)
@@ -3,47 +3,62 @@
     {
       "arch": "x86",
       "current": true,
-      "CPU": 0,
-      "qom_path": "/machine/unattached/device[0]",
-      "pc": -2130415978,
-      "halted": true,
-      "thread_id": 518291
+      "cpu-index": 0,
+      "props": {
+        "core-id": 0,
+        "thread-id": 0,
+        "socket-id": 0
+      },
+      "qom-path": "/machine/unattached/device[0]",
+      "thread-id": 518291
     },
     {
       "arch": "x86",
       "current": false,
-      "CPU": 1,
-      "qom_path": "/machine/unattached/device[2]",
-      "pc": -2130415978,
-      "halted": true,
-      "thread_id": 518292
+      "cpu-index": 1,
+      "props": {
+        "core-id": 1,
+        "thread-id": 0,
+        "socket-id": 0
+      },
+      "qom-path": "/machine/unattached/device[2]",
+      "thread-id": 518292
     },
     {
       "arch": "x86",
       "current": false,
-      "CPU": 2,
-      "qom_path": "/machine/unattached/device[3]",
-      "pc": -2130415978,
-      "halted": true,
-      "thread_id": 518294
+      "cpu-index": 2,
+      "props": {
+        "core-id": 1,
+        "thread-id": 1,
+        "socket-id": 0
+      },
+      "qom-path": "/machine/unattached/device[3]",
+      "thread-id": 518294
     },
     {
       "arch": "x86",
       "current": false,
-      "CPU": 3,
-      "qom_path": "/machine/unattached/device[4]",
-      "pc": -2130415978,
-      "halted": true,
-      "thread_id": 518295
+      "cpu-index": 3,
+      "props": {
+        "core-id": 0,
+        "thread-id": 0,
+        "socket-id": 1
+      },
+      "qom-path": "/machine/unattached/device[4]",
+      "thread-id": 518295
     },
     {
       "arch": "x86",
       "current": false,
-      "CPU": 4,
-      "qom_path": "/machine/unattached/device[5]",
-      "pc": -2130415978,
-      "halted": true,
-      "thread_id": 518296
+      "cpu-index": 4,
+      "props": {
+        "core-id": 0,
+        "thread-id": 1,
+        "socket-id": 1
+      },
+      "qom-path": "/machine/unattached/device[5]",
+      "thread-id": 518296
     }
   ],
   "id": "libvirt-22"
index 9a1788d94740aeb08cc32faa1d922aeb93f1f865..93cefb9dd24569f71bc9b0bead1984caaf286450 100644 (file)
@@ -7,7 +7,6 @@
     type='qemu64-x86_64-cpu'
     qom_path='/machine/unattached/device[0]'
     topology: socket='0' core='0' thread='0' vcpus='1'
-    halted
 [vcpu libvirt-id='1']
     online=yes
     hotpluggable=no
@@ -17,7 +16,6 @@
     type='qemu64-x86_64-cpu'
     qom_path='/machine/unattached/device[2]'
     topology: socket='0' core='0' thread='1' vcpus='1'
-    halted
 [vcpu libvirt-id='2']
     online=yes
     hotpluggable=no
@@ -27,7 +25,6 @@
     type='qemu64-x86_64-cpu'
     qom_path='/machine/unattached/device[3]'
     topology: socket='0' core='1' thread='0' vcpus='1'
-    halted
 [vcpu libvirt-id='3']
     online=yes
     hotpluggable=no
@@ -37,7 +34,6 @@
     type='qemu64-x86_64-cpu'
     qom_path='/machine/unattached/device[4]'
     topology: socket='0' core='1' thread='1' vcpus='1'
-    halted
 [vcpu libvirt-id='4']
     online=yes
     hotpluggable=no
@@ -47,7 +43,6 @@
     type='qemu64-x86_64-cpu'
     qom_path='/machine/unattached/device[5]'
     topology: socket='1' core='0' thread='0' vcpus='1'
-    halted
 [vcpu libvirt-id='5']
     online=no
     hotpluggable=yes
index 6b39efa69cea78cd900f8bc9786e2634bc89f1b5..a3845123303995bde67367be02abdd5f03640081 100644 (file)
@@ -9,11 +9,9 @@
         "node-id": 0,
         "socket-id": 0
       },
-      "CPU": 0,
-      "qom_path": "/machine/unattached/device[0]",
-      "pc": 1048956,
-      "halted": true,
-      "thread_id": 2033724
+      "cpu-index": 0,
+      "qom-path": "/machine/unattached/device[0]",
+      "thread-id": 2033724
     },
     {
       "arch": "x86",
         "node-id": 1,
         "socket-id": 0
       },
-      "CPU": 1,
-      "qom_path": "/machine/unattached/device[2]",
-      "pc": 1037318,
-      "halted": true,
-      "thread_id": 2033725
+      "cpu-index": 1,
+      "qom-path": "/machine/unattached/device[2]",
+      "thread-id": 2033725
     }
   ],
   "id": "libvirt-21"
index 0f7dbf134950f3492f2969d3aaa44d026f324a07..070ea084e7e86031bfcdd4ddb5a135630c0f45da 100644 (file)
@@ -7,7 +7,6 @@
     type='Broadwell-x86_64-cpu'
     qom_path='/machine/unattached/device[0]'
     topology: socket='0' core='0' thread='0' node='0' vcpus='1'
-    halted
 [vcpu libvirt-id='1']
     online=yes
     hotpluggable=no
@@ -17,7 +16,6 @@
     type='Broadwell-x86_64-cpu'
     qom_path='/machine/unattached/device[2]'
     topology: socket='0' core='0' thread='1' node='1' vcpus='1'
-    halted
 [vcpu libvirt-id='2']
     online=no
     hotpluggable=yes
index 56620f16a62b511b1590ff4dd3a7fdcdd0cca1b2..0001df7bb3ccfcda6327b62f011f66620f579ff0 100644 (file)
@@ -3114,9 +3114,9 @@ mymain(void)
     DO_TEST_CPU_DATA("full");
     DO_TEST_CPU_DATA("ecx");
 
-    DO_TEST_CPU_INFO("x86-basic-pluggable", 8);
+    DO_TEST_CPU_INFO_FAST("x86-basic-pluggable", 8);
     DO_TEST_CPU_INFO_FAST("x86-full", 11);
-    DO_TEST_CPU_INFO("x86-node-full", 8);
+    DO_TEST_CPU_INFO_FAST("x86-node-full", 8);
     DO_TEST_CPU_INFO_FAST("x86-dies", 16);
 
     DO_TEST_CPU_INFO_FAST("ppc64-basic", 24);