Add a positive test and few negative tests. --- tests/qemuhotplugtest.c | 4 + tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml | 20 + tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json | 593 +++++++++++++++++++++ .../qemuhotplugtestcpus/ppc64-bulk-result-conf.xml | 64 +++ .../qemuhotplugtestcpus/ppc64-bulk-result-live.xml | 72 +++ 5 files changed, 753 insertions(+) create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-result-conf.xml create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-result-live.xml diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index f0817eb86..44a5e69ae 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -773,6 +773,10 @@ mymain(void) DO_TEST_CPU_GROUP("x86-modern-bulk", 7, true, false); DO_TEST_CPU_GROUP("x86-old-bulk", 7, false, false); + DO_TEST_CPU_GROUP("ppc64-bulk", 24, true, false); + DO_TEST_CPU_GROUP("ppc64-bulk", 15, true, true); + DO_TEST_CPU_GROUP("ppc64-bulk", 23, true, true); + DO_TEST_CPU_GROUP("ppc64-bulk", 25, true, true); qemuTestDriverFree(&driver); return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE; diff --git a/tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml b/tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml new file mode 100644 index 000000000..eb04e42b6 --- /dev/null +++ b/tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml @@ -0,0 +1,20 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static' current='8'>32</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='network'/> + </os> + <cpu> + <topology sockets="1" cores="4" threads="8"/> + </cpu> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + </devices> +</domain> diff --git a/tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json b/tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json new file mode 100644 index 000000000..c139426b7 --- /dev/null +++ b/tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json @@ -0,0 +1,593 @@ +{"execute":"query-hotpluggable-cpus","id":"libvirt-1"} + +{ + "return": [ + { + "props": { + "core-id": 24 + }, + "vcpus-count": 8, + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 16 + }, + "vcpus-count": 8, + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 8 + }, + "vcpus-count": 8, + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 0 + }, + "vcpus-count": 8, + "qom-path": "/machine/unattached/device[1]", + "type": "host-spapr-cpu-core" + } + ], + "id": "libvirt-15" +} + +{"execute":"query-cpus","id":"libvirt-2"} + +{ + "return": [ + { + "arch": "ppc", + "current": true, + "CPU": 0, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[0]", + "halted": false, + "thread_id": 21925 + }, + { + "arch": "ppc", + "current": false, + "CPU": 1, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[1]", + "halted": false, + "thread_id": 21926 + }, + { + "arch": "ppc", + "current": false, + "CPU": 2, + "nip": -4611686018422360608, + "qom_path": "/machine/unattached/device[1]/thread[2]", + "halted": false, + "thread_id": 21927 + }, + { + "arch": "ppc", + "current": false, + "CPU": 3, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[3]", + "halted": false, + "thread_id": 21928 + }, + { + "arch": "ppc", + "current": false, + "CPU": 4, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[4]", + "halted": false, + "thread_id": 21930 + }, + { + "arch": "ppc", + "current": false, + "CPU": 5, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[5]", + "halted": false, + "thread_id": 21931 + }, + { + "arch": "ppc", + "current": false, + "CPU": 6, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[6]", + "halted": false, + "thread_id": 21932 + }, + { + "arch": "ppc", + "current": false, + "CPU": 7, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[7]", + "halted": false, + "thread_id": 21933 + } + ], + "id": "libvirt-12" +} + +{ + "execute": "device_add", + "arguments": { + "driver": "host-spapr-cpu-core", + "id": "vcpu8", + "core-id": 8 + }, + "id": "libvirt-3" +} + +{"return": {}} + +{"execute":"query-hotpluggable-cpus","id":"libvirt-4"} + +{ + "return": [ + { + "props": { + "core-id": 24 + }, + "vcpus-count": 8, + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 16 + }, + "vcpus-count": 8, + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 8 + }, + "vcpus-count": 8, + "qom-path": "/machine/peripheral/vcpu1", + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 0 + }, + "vcpus-count": 8, + "qom-path": "/machine/unattached/device[1]", + "type": "host-spapr-cpu-core" + } + ], + "id": "libvirt-15" +} + +{"execute":"query-cpus","id":"libvirt-5"} + +{ + "return": [ + { + "arch": "ppc", + "current": true, + "CPU": 0, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[0]", + "halted": false, + "thread_id": 21925 + }, + { + "arch": "ppc", + "current": false, + "CPU": 1, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[1]", + "halted": false, + "thread_id": 21926 + }, + { + "arch": "ppc", + "current": false, + "CPU": 2, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[2]", + "halted": false, + "thread_id": 21927 + }, + { + "arch": "ppc", + "current": false, + "CPU": 3, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[3]", + "halted": false, + "thread_id": 21928 + }, + { + "arch": "ppc", + "current": false, + "CPU": 4, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[4]", + "halted": false, + "thread_id": 21930 + }, + { + "arch": "ppc", + "current": false, + "CPU": 5, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[5]", + "halted": false, + "thread_id": 21931 + }, + { + "arch": "ppc", + "current": false, + "CPU": 6, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[6]", + "halted": false, + "thread_id": 21932 + }, + { + "arch": "ppc", + "current": false, + "CPU": 7, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[7]", + "halted": false, + "thread_id": 21933 + }, + { + "arch": "ppc", + "current": false, + "CPU": 8, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[0]", + "halted": false, + "thread_id": 22131 + }, + { + "arch": "ppc", + "current": false, + "CPU": 9, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[1]", + "halted": false, + "thread_id": 22132 + }, + { + "arch": "ppc", + "current": false, + "CPU": 10, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[2]", + "halted": false, + "thread_id": 22133 + }, + { + "arch": "ppc", + "current": false, + "CPU": 11, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[3]", + "halted": false, + "thread_id": 22134 + }, + { + "arch": "ppc", + "current": false, + "CPU": 12, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[4]", + "halted": false, + "thread_id": 22135 + }, + { + "arch": "ppc", + "current": false, + "CPU": 13, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[5]", + "halted": false, + "thread_id": 22136 + }, + { + "arch": "ppc", + "current": false, + "CPU": 14, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[6]", + "halted": false, + "thread_id": 22137 + }, + { + "arch": "ppc", + "current": false, + "CPU": 15, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[7]", + "halted": false, + "thread_id": 22138 + } + ], + "id": "libvirt-14" +} + +{ + "execute": "device_add", + "arguments": { + "driver": "host-spapr-cpu-core", + "id": "vcpu16", + "core-id": 16 + }, + "id": "libvirt-6" +} + +{"return": {}} + +{"execute":"query-hotpluggable-cpus","id":"libvirt-7"} + +{ + "return": [ + { + "props": { + "core-id": 24 + }, + "vcpus-count": 8, + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 16 + }, + "vcpus-count": 8, + "qom-path": "/machine/peripheral/vcpu2", + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 8 + }, + "vcpus-count": 8, + "qom-path": "/machine/peripheral/vcpu1", + "type": "host-spapr-cpu-core" + }, + { + "props": { + "core-id": 0 + }, + "vcpus-count": 8, + "qom-path": "/machine/unattached/device[1]", + "type": "host-spapr-cpu-core" + } + ], + "id": "libvirt-15" +} + +{"execute":"query-cpus","id":"libvirt-8"} + +{ + "return": [ + { + "arch": "ppc", + "current": true, + "CPU": 0, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[0]", + "halted": false, + "thread_id": 21925 + }, + { + "arch": "ppc", + "current": false, + "CPU": 1, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[1]", + "halted": false, + "thread_id": 21926 + }, + { + "arch": "ppc", + "current": false, + "CPU": 2, + "nip": -4611686018422360576, + "qom_path": "/machine/unattached/device[1]/thread[2]", + "halted": false, + "thread_id": 21927 + }, + { + "arch": "ppc", + "current": false, + "CPU": 3, + "nip": -4611686018422360596, + "qom_path": "/machine/unattached/device[1]/thread[3]", + "halted": false, + "thread_id": 21928 + }, + { + "arch": "ppc", + "current": false, + "CPU": 4, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[4]", + "halted": false, + "thread_id": 21930 + }, + { + "arch": "ppc", + "current": false, + "CPU": 5, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[5]", + "halted": false, + "thread_id": 21931 + }, + { + "arch": "ppc", + "current": false, + "CPU": 6, + "nip": -4611686018426772172, + "qom_path": "/machine/unattached/device[1]/thread[6]", + "halted": false, + "thread_id": 21932 + }, + { + "arch": "ppc", + "current": false, + "CPU": 7, + "nip": -4611686018422360596, + "qom_path": "/machine/unattached/device[1]/thread[7]", + "halted": false, + "thread_id": 21933 + }, + { + "arch": "ppc", + "current": false, + "CPU": 8, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[0]", + "halted": false, + "thread_id": 22131 + }, + { + "arch": "ppc", + "current": false, + "CPU": 9, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[1]", + "halted": false, + "thread_id": 22132 + }, + { + "arch": "ppc", + "current": false, + "CPU": 10, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[2]", + "halted": false, + "thread_id": 22133 + }, + { + "arch": "ppc", + "current": false, + "CPU": 11, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[3]", + "halted": false, + "thread_id": 22134 + }, + { + "arch": "ppc", + "current": false, + "CPU": 12, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[4]", + "halted": false, + "thread_id": 22135 + }, + { + "arch": "ppc", + "current": false, + "CPU": 13, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[5]", + "halted": false, + "thread_id": 22136 + }, + { + "arch": "ppc", + "current": false, + "CPU": 14, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[6]", + "halted": false, + "thread_id": 22137 + }, + { + "arch": "ppc", + "current": false, + "CPU": 15, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu1/thread[7]", + "halted": false, + "thread_id": 22138 + }, + { + "arch": "ppc", + "current": false, + "CPU": 16, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu2/thread[0]", + "halted": false, + "thread_id": 22223 + }, + { + "arch": "ppc", + "current": false, + "CPU": 17, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu2/thread[1]", + "halted": false, + "thread_id": 22224 + }, + { + "arch": "ppc", + "current": false, + "CPU": 18, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu2/thread[2]", + "halted": false, + "thread_id": 22225 + }, + { + "arch": "ppc", + "current": false, + "CPU": 19, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu2/thread[3]", + "halted": false, + "thread_id": 22226 + }, + { + "arch": "ppc", + "current": false, + "CPU": 20, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu2/thread[4]", + "halted": false, + "thread_id": 22227 + }, + { + "arch": "ppc", + "current": false, + "CPU": 21, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu2/thread[5]", + "halted": false, + "thread_id": 22228 + }, + { + "arch": "ppc", + "current": false, + "CPU": 22, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu2/thread[6]", + "halted": false, + "thread_id": 22229 + }, + { + "arch": "ppc", + "current": false, + "CPU": 23, + "nip": -4611686018426772172, + "qom_path": "/machine/peripheral/vcpu2/thread[7]", + "halted": false, + "thread_id": 22230 + } + ], + "id": "libvirt-17" +} diff --git a/tests/qemuhotplugtestcpus/ppc64-bulk-result-conf.xml b/tests/qemuhotplugtestcpus/ppc64-bulk-result-conf.xml new file mode 100644 index 000000000..bd792eaae --- /dev/null +++ b/tests/qemuhotplugtestcpus/ppc64-bulk-result-conf.xml @@ -0,0 +1,64 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static' current='24'>32</vcpu> + <vcpus> + <vcpu id='0' enabled='yes' hotpluggable='no'/> + <vcpu id='1' enabled='yes' hotpluggable='no'/> + <vcpu id='2' enabled='yes' hotpluggable='no'/> + <vcpu id='3' enabled='yes' hotpluggable='no'/> + <vcpu id='4' enabled='yes' hotpluggable='no'/> + <vcpu id='5' enabled='yes' hotpluggable='no'/> + <vcpu id='6' enabled='yes' hotpluggable='no'/> + <vcpu id='7' enabled='yes' hotpluggable='no'/> + <vcpu id='8' enabled='yes' hotpluggable='yes'/> + <vcpu id='9' enabled='yes' hotpluggable='yes'/> + <vcpu id='10' enabled='yes' hotpluggable='yes'/> + <vcpu id='11' enabled='yes' hotpluggable='yes'/> + <vcpu id='12' enabled='yes' hotpluggable='yes'/> + <vcpu id='13' enabled='yes' hotpluggable='yes'/> + <vcpu id='14' enabled='yes' hotpluggable='yes'/> + <vcpu id='15' enabled='yes' hotpluggable='yes'/> + <vcpu id='16' enabled='yes' hotpluggable='yes'/> + <vcpu id='17' enabled='yes' hotpluggable='yes'/> + <vcpu id='18' enabled='yes' hotpluggable='yes'/> + <vcpu id='19' enabled='yes' hotpluggable='yes'/> + <vcpu id='20' enabled='yes' hotpluggable='yes'/> + <vcpu id='21' enabled='yes' hotpluggable='yes'/> + <vcpu id='22' enabled='yes' hotpluggable='yes'/> + <vcpu id='23' enabled='yes' hotpluggable='yes'/> + <vcpu id='24' enabled='no' hotpluggable='yes'/> + <vcpu id='25' enabled='no' hotpluggable='yes'/> + <vcpu id='26' enabled='no' hotpluggable='yes'/> + <vcpu id='27' enabled='no' hotpluggable='yes'/> + <vcpu id='28' enabled='no' hotpluggable='yes'/> + <vcpu id='29' enabled='no' hotpluggable='yes'/> + <vcpu id='30' enabled='no' hotpluggable='yes'/> + <vcpu id='31' enabled='no' hotpluggable='yes'/> + </vcpus> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='network'/> + </os> + <cpu> + <topology sockets='1' cores='4' threads='8'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <controller type='usb' index='0'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <memballoon model='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> diff --git a/tests/qemuhotplugtestcpus/ppc64-bulk-result-live.xml b/tests/qemuhotplugtestcpus/ppc64-bulk-result-live.xml new file mode 100644 index 000000000..da40fec89 --- /dev/null +++ b/tests/qemuhotplugtestcpus/ppc64-bulk-result-live.xml @@ -0,0 +1,72 @@ +<domain type='qemu' id='7'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static' current='24'>32</vcpu> + <vcpus> + <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/> + <vcpu id='1' enabled='yes' hotpluggable='no' order='1'/> + <vcpu id='2' enabled='yes' hotpluggable='no' order='1'/> + <vcpu id='3' enabled='yes' hotpluggable='no' order='1'/> + <vcpu id='4' enabled='yes' hotpluggable='no' order='1'/> + <vcpu id='5' enabled='yes' hotpluggable='no' order='1'/> + <vcpu id='6' enabled='yes' hotpluggable='no' order='1'/> + <vcpu id='7' enabled='yes' hotpluggable='no' order='1'/> + <vcpu id='8' enabled='yes' hotpluggable='yes' order='2'/> + <vcpu id='9' enabled='yes' hotpluggable='yes' order='2'/> + <vcpu id='10' enabled='yes' hotpluggable='yes' order='2'/> + <vcpu id='11' enabled='yes' hotpluggable='yes' order='2'/> + <vcpu id='12' enabled='yes' hotpluggable='yes' order='2'/> + <vcpu id='13' enabled='yes' hotpluggable='yes' order='2'/> + <vcpu id='14' enabled='yes' hotpluggable='yes' order='2'/> + <vcpu id='15' enabled='yes' hotpluggable='yes' order='2'/> + <vcpu id='16' enabled='yes' hotpluggable='yes' order='3'/> + <vcpu id='17' enabled='yes' hotpluggable='yes' order='3'/> + <vcpu id='18' enabled='yes' hotpluggable='yes' order='3'/> + <vcpu id='19' enabled='yes' hotpluggable='yes' order='3'/> + <vcpu id='20' enabled='yes' hotpluggable='yes' order='3'/> + <vcpu id='21' enabled='yes' hotpluggable='yes' order='3'/> + <vcpu id='22' enabled='yes' hotpluggable='yes' order='3'/> + <vcpu id='23' enabled='yes' hotpluggable='yes' order='3'/> + <vcpu id='24' enabled='no' hotpluggable='yes'/> + <vcpu id='25' enabled='no' hotpluggable='yes'/> + <vcpu id='26' enabled='no' hotpluggable='yes'/> + <vcpu id='27' enabled='no' hotpluggable='yes'/> + <vcpu id='28' enabled='no' hotpluggable='yes'/> + <vcpu id='29' enabled='no' hotpluggable='yes'/> + <vcpu id='30' enabled='no' hotpluggable='yes'/> + <vcpu id='31' enabled='no' hotpluggable='yes'/> + </vcpus> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='network'/> + </os> + <cpu> + <topology sockets='1' cores='4' threads='8'/> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <controller type='usb' index='0'> + <alias name='usb'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'> + <alias name='pci'/> + </controller> + <input type='mouse' bus='ps2'> + <alias name='input0'/> + </input> + <input type='keyboard' bus='ps2'> + <alias name='input1'/> + </input> + <memballoon model='virtio'> + <alias name='balloon0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </memballoon> + </devices> +</domain> -- 2.11.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list