tests: convert x86_64 tests to query-cpus-fast

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>
This commit is contained in:
Paolo Bonzini 2022-08-08 17:15:05 +02:00 committed by Peter Krempa
parent eb98eb0ce8
commit 332ea27164
5 changed files with 48 additions and 44 deletions

View 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"

View 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

View 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",
@ -24,11 +22,9 @@
"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"

View 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

View 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);