diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-cpus.json new file mode 100644 index 0000000000..f90e4ba175 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-cpus.json @@ -0,0 +1,95 @@ +{ + "return": [ + { + "arch": "x86", + "thread-id": 1538346, + "props": { + "core-id": 0, + "thread-id": 0, + "die-id": 0, + "socket-id": 0 + }, + "qom-path": "/machine/unattached/device[0]", + "cpu-index": 0, + "target": "x86_64" + }, + { + "arch": "x86", + "thread-id": 1538347, + "props": { + "core-id": 0, + "thread-id": 1, + "die-id": 0, + "socket-id": 0 + }, + "qom-path": "/machine/unattached/device[2]", + "cpu-index": 1, + "target": "x86_64" + }, + { + "arch": "x86", + "thread-id": 1538348, + "props": { + "core-id": 1, + "thread-id": 0, + "die-id": 0, + "socket-id": 0 + }, + "qom-path": "/machine/unattached/device[3]", + "cpu-index": 2, + "target": "x86_64" + }, + { + "arch": "x86", + "thread-id": 1538349, + "props": { + "core-id": 1, + "thread-id": 1, + "die-id": 0, + "socket-id": 0 + }, + "qom-path": "/machine/unattached/device[4]", + "cpu-index": 3, + "target": "x86_64" + }, + { + "arch": "x86", + "thread-id": 1538350, + "props": { + "core-id": 0, + "thread-id": 0, + "die-id": 1, + "socket-id": 0 + }, + "qom-path": "/machine/unattached/device[5]", + "cpu-index": 4, + "target": "x86_64" + }, + { + "arch": "x86", + "thread-id": 1538351, + "props": { + "core-id": 0, + "thread-id": 1, + "die-id": 1, + "socket-id": 0 + }, + "qom-path": "/machine/unattached/device[6]", + "cpu-index": 5, + "target": "x86_64" + }, + { + "arch": "x86", + "thread-id": 1538352, + "props": { + "core-id": 1, + "thread-id": 0, + "die-id": 1, + "socket-id": 0 + }, + "qom-path": "/machine/unattached/device[7]", + "cpu-index": 6, + "target": "x86_64" + } + ] +} diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-hotplug.json new file mode 100644 index 0000000000..294f470b91 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies-hotplug.json @@ -0,0 +1,171 @@ +{ + "return": [ + { + "props": { + "core-id": 1, + "thread-id": 1, + "die-id": 1, + "socket-id": 1 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 1, + "thread-id": 0, + "die-id": 1, + "socket-id": 1 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 0, + "thread-id": 1, + "die-id": 1, + "socket-id": 1 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 0, + "thread-id": 0, + "die-id": 1, + "socket-id": 1 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 1, + "thread-id": 1, + "die-id": 0, + "socket-id": 1 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 1, + "thread-id": 0, + "die-id": 0, + "socket-id": 1 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 0, + "thread-id": 1, + "die-id": 0, + "socket-id": 1 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 0, + "thread-id": 0, + "die-id": 0, + "socket-id": 1 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 1, + "thread-id": 1, + "die-id": 1, + "socket-id": 0 + }, + "vcpus-count": 1, + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 1, + "thread-id": 0, + "die-id": 1, + "socket-id": 0 + }, + "vcpus-count": 1, + "qom-path": "/machine/unattached/device[7]", + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 0, + "thread-id": 1, + "die-id": 1, + "socket-id": 0 + }, + "vcpus-count": 1, + "qom-path": "/machine/unattached/device[6]", + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 0, + "thread-id": 0, + "die-id": 1, + "socket-id": 0 + }, + "vcpus-count": 1, + "qom-path": "/machine/unattached/device[5]", + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 1, + "thread-id": 1, + "die-id": 0, + "socket-id": 0 + }, + "vcpus-count": 1, + "qom-path": "/machine/unattached/device[4]", + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 1, + "thread-id": 0, + "die-id": 0, + "socket-id": 0 + }, + "vcpus-count": 1, + "qom-path": "/machine/unattached/device[3]", + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 0, + "thread-id": 1, + "die-id": 0, + "socket-id": 0 + }, + "vcpus-count": 1, + "qom-path": "/machine/unattached/device[2]", + "type": "host-x86_64-cpu" + }, + { + "props": { + "core-id": 0, + "thread-id": 0, + "die-id": 0, + "socket-id": 0 + }, + "vcpus-count": 1, + "qom-path": "/machine/unattached/device[0]", + "type": "host-x86_64-cpu" + } + ] +} diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies.data new file mode 100644 index 0000000000..a839b56989 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-x86-dies.data @@ -0,0 +1,108 @@ +[vcpu libvirt-id='0'] + online=yes + hotpluggable=no + thread-id='1538346' + enable-id='1' + query-cpus-id='0' + type='host-x86_64-cpu' + qom_path='/machine/unattached/device[0]' + topology: socket='0' die='0' core='0' thread='0' vcpus='1' +[vcpu libvirt-id='1'] + online=yes + hotpluggable=no + thread-id='1538347' + enable-id='2' + query-cpus-id='1' + type='host-x86_64-cpu' + qom_path='/machine/unattached/device[2]' + topology: socket='0' die='0' core='0' thread='1' vcpus='1' +[vcpu libvirt-id='2'] + online=yes + hotpluggable=no + thread-id='1538348' + enable-id='3' + query-cpus-id='2' + type='host-x86_64-cpu' + qom_path='/machine/unattached/device[3]' + topology: socket='0' die='0' core='1' thread='0' vcpus='1' +[vcpu libvirt-id='3'] + online=yes + hotpluggable=no + thread-id='1538349' + enable-id='4' + query-cpus-id='3' + type='host-x86_64-cpu' + qom_path='/machine/unattached/device[4]' + topology: socket='0' die='0' core='1' thread='1' vcpus='1' +[vcpu libvirt-id='4'] + online=yes + hotpluggable=no + thread-id='1538350' + enable-id='5' + query-cpus-id='4' + type='host-x86_64-cpu' + qom_path='/machine/unattached/device[5]' + topology: socket='0' die='1' core='0' thread='0' vcpus='1' +[vcpu libvirt-id='5'] + online=yes + hotpluggable=no + thread-id='1538351' + enable-id='6' + query-cpus-id='5' + type='host-x86_64-cpu' + qom_path='/machine/unattached/device[6]' + topology: socket='0' die='1' core='0' thread='1' vcpus='1' +[vcpu libvirt-id='6'] + online=yes + hotpluggable=no + thread-id='1538352' + enable-id='7' + query-cpus-id='6' + type='host-x86_64-cpu' + qom_path='/machine/unattached/device[7]' + topology: socket='0' die='1' core='1' thread='0' vcpus='1' +[vcpu libvirt-id='7'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='0' die='1' core='1' thread='1' vcpus='1' +[vcpu libvirt-id='8'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='1' die='0' core='0' thread='0' vcpus='1' +[vcpu libvirt-id='9'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='1' die='0' core='0' thread='1' vcpus='1' +[vcpu libvirt-id='10'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='1' die='0' core='1' thread='0' vcpus='1' +[vcpu libvirt-id='11'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='1' die='0' core='1' thread='1' vcpus='1' +[vcpu libvirt-id='12'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='1' die='1' core='0' thread='0' vcpus='1' +[vcpu libvirt-id='13'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='1' die='1' core='0' thread='1' vcpus='1' +[vcpu libvirt-id='14'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='1' die='1' core='1' thread='0' vcpus='1' +[vcpu libvirt-id='15'] + online=no + hotpluggable=yes + type='host-x86_64-cpu' + topology: socket='1' die='1' core='1' thread='1' vcpus='1' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 0a6760a794..472775a3cf 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2615,6 +2615,8 @@ testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfoPtr vcpus, virBufferAddLit(&buf, "topology:"); if (vcpu->socket_id != -1) virBufferAsprintf(&buf, " socket='%d'", vcpu->socket_id); + if (vcpu->die_id != -1) + virBufferAsprintf(&buf, " die='%d'", vcpu->die_id); if (vcpu->core_id != -1) virBufferAsprintf(&buf, " core='%d'", vcpu->core_id); if (vcpu->thread_id != -1) @@ -3235,6 +3237,7 @@ mymain(void) DO_TEST_CPU_INFO("x86-full", 11); DO_TEST_CPU_INFO("x86-node-full", 8); DO_TEST_CPU_INFO_FAST("x86-full-fast", 11); + DO_TEST_CPU_INFO_FAST("x86-dies", 16); DO_TEST_CPU_INFO("ppc64-basic", 24); DO_TEST_CPU_INFO("ppc64-hotplug-1", 24);