tests: Add xml->argv and xml->xml tests for the new iothread mapping feature

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-03-01 14:40:02 +01:00
parent 397218c433
commit ee334337a0
3 changed files with 56 additions and 8 deletions

View File

@ -19,6 +19,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-smp 2,sockets=2,cores=1,threads=1 \
-object '{"qom-type":"iothread","id":"iothread1"}' \
-object '{"qom-type":"iothread","id":"iothread2"}' \
-object '{"qom-type":"iothread","id":"iothread3"}' \
-object '{"qom-type":"iothread","id":"iothread4"}' \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
-no-user-config \
@ -29,12 +31,15 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-no-shutdown \
-boot strict=on \
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/iothrtest1.img","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/iothrtest1.img","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw","file":"libvirt-3-storage"}' \
-device '{"driver":"virtio-blk-pci","iothread":"iothread1","bus":"pci.0","addr":"0x4","drive":"libvirt-3-format","id":"virtio-disk1","bootindex":1}' \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/iothrtest2.img","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw","file":"libvirt-2-storage"}' \
-device '{"driver":"virtio-blk-pci","iothread":"iothread1","bus":"pci.0","addr":"0x4","drive":"libvirt-2-format","id":"virtio-disk1","bootindex":1}' \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/iothrtest2.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-device '{"driver":"virtio-blk-pci","num-queues":4,"iothread-vq-mapping":[{"iothread":"iothread2","vqs":[1,3]},{"iothread":"iothread3","vqs":[0,2]}],"bus":"pci.0","addr":"0x2","drive":"libvirt-2-format","id":"virtio-disk2"}' \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/iothrtest3.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
-device '{"driver":"virtio-blk-pci","iothread":"iothread2","bus":"pci.0","addr":"0x2","drive":"libvirt-1-format","id":"virtio-disk2"}' \
-device '{"driver":"virtio-blk-pci","iothread-vq-mapping":[{"iothread":"iothread4"},{"iothread":"iothread1"}],"bus":"pci.0","addr":"0x3","drive":"libvirt-1-format","id":"virtio-disk3"}' \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -4,7 +4,7 @@
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
<vcpu placement='static'>2</vcpu>
<iothreads>2</iothreads>
<iothreads>4</iothreads>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
@ -22,10 +22,31 @@
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' iothread='2'/>
<driver name='qemu' type='raw' queues='4'>
<iothreads>
<iothread id='2'>
<queue id='1'/>
<queue id='3'/>
</iothread>
<iothread id='3'>
<queue id='0'/>
<queue id='2'/>
</iothread>
</iothreads>
</driver>
<source file='/var/lib/libvirt/images/iothrtest2.img'/>
<target dev='vdc' bus='virtio'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'>
<iothreads>
<iothread id='4'/>
<iothread id='1'/>
</iothreads>
</driver>
<source file='/var/lib/libvirt/images/iothrtest3.img'/>
<target dev='vdd' bus='virtio'/>
</disk>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
<controller type='pci' index='0' model='pci-root'/>

View File

@ -4,7 +4,7 @@
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
<vcpu placement='static'>2</vcpu>
<iothreads>2</iothreads>
<iothreads>4</iothreads>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
@ -25,11 +25,33 @@
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' iothread='2'/>
<driver name='qemu' type='raw' queues='4'>
<iothreads>
<iothread id='2'>
<queue id='1'/>
<queue id='3'/>
</iothread>
<iothread id='3'>
<queue id='0'/>
<queue id='2'/>
</iothread>
</iothreads>
</driver>
<source file='/var/lib/libvirt/images/iothrtest2.img'/>
<target dev='vdc' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'>
<iothreads>
<iothread id='4'/>
<iothread id='1'/>
</iothreads>
</driver>
<source file='/var/lib/libvirt/images/iothrtest3.img'/>
<target dev='vdd' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</disk>
<controller type='usb' index='0' model='piix3-uhci'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>