mirror of https://gitee.com/openkylin/libvirt.git
tests: hotplug: Add test data for legacy cpu hotplug
Test that the old approach generates correct commands.
This commit is contained in:
parent
a245abce43
commit
69613157bb
|
@ -772,6 +772,7 @@ mymain(void)
|
|||
} while (0)
|
||||
|
||||
DO_TEST_CPU_GROUP("x86-modern-bulk", 7, true, false);
|
||||
DO_TEST_CPU_GROUP("x86-old-bulk", 7, false, false);
|
||||
|
||||
qemuTestDriverFree(&driver);
|
||||
return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<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='5'>8</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64' machine='pc'>hvm</type>
|
||||
<boot dev='network'/>
|
||||
</os>
|
||||
<cpu>
|
||||
<topology sockets="4" cores="2" threads="1"/>
|
||||
</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>
|
||||
</devices>
|
||||
</domain>
|
|
@ -0,0 +1,193 @@
|
|||
{"execute":"query-cpus","id":"libvirt-1"}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": true,
|
||||
"CPU": 0,
|
||||
"qom_path": "/machine/unattached/device[0]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518291
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 1,
|
||||
"qom_path": "/machine/unattached/device[2]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518292
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 2,
|
||||
"qom_path": "/machine/unattached/device[3]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518294
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 3,
|
||||
"qom_path": "/machine/unattached/device[4]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518295
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 4,
|
||||
"qom_path": "/machine/unattached/device[5]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518296
|
||||
}
|
||||
],
|
||||
"id": "libvirt-22"
|
||||
}
|
||||
|
||||
{"execute":"cpu-add","arguments":{"id":5},"id":"libvirt-2"}
|
||||
|
||||
{"return": {}}
|
||||
|
||||
{"execute":"query-cpus","id":"libvirt-3"}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": true,
|
||||
"CPU": 0,
|
||||
"qom_path": "/machine/unattached/device[0]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518291
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 1,
|
||||
"qom_path": "/machine/unattached/device[2]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518292
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 2,
|
||||
"qom_path": "/machine/unattached/device[3]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518294
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 3,
|
||||
"qom_path": "/machine/unattached/device[4]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518295
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 4,
|
||||
"qom_path": "/machine/unattached/device[5]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518296
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 5,
|
||||
"qom_path": "/machine/peripheral/vcpu5",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518297
|
||||
}
|
||||
],
|
||||
"id": "libvirt-22"
|
||||
}
|
||||
|
||||
{"execute":"cpu-add","arguments":{"id":6},"id":"libvirt-4"}
|
||||
|
||||
{"return": {}}
|
||||
|
||||
{"execute":"query-cpus","id":"libvirt-5"}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": true,
|
||||
"CPU": 0,
|
||||
"qom_path": "/machine/unattached/device[0]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518291
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 1,
|
||||
"qom_path": "/machine/unattached/device[2]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518292
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 2,
|
||||
"qom_path": "/machine/unattached/device[3]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518294
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 3,
|
||||
"qom_path": "/machine/unattached/device[4]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518295
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 4,
|
||||
"qom_path": "/machine/unattached/device[5]",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518296
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 5,
|
||||
"qom_path": "/machine/peripheral/vcpu5",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518297
|
||||
},
|
||||
{
|
||||
"arch": "x86",
|
||||
"current": false,
|
||||
"CPU": 6,
|
||||
"qom_path": "/machine/peripheral/vcpu6",
|
||||
"pc": -2130415978,
|
||||
"halted": true,
|
||||
"thread_id": 518298
|
||||
}
|
||||
],
|
||||
"id": "libvirt-22"
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<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='7'>8</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64' machine='pc'>hvm</type>
|
||||
<boot dev='network'/>
|
||||
</os>
|
||||
<cpu>
|
||||
<topology sockets='4' cores='2' threads='1'/>
|
||||
</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>
|
|
@ -0,0 +1,38 @@
|
|||
<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='7'>8</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64' machine='pc'>hvm</type>
|
||||
<boot dev='network'/>
|
||||
</os>
|
||||
<cpu>
|
||||
<topology sockets='4' cores='2' threads='1'/>
|
||||
</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>
|
Loading…
Reference in New Issue