qemu: Allow use of iothreads for virtio ccw disk definitions

Extending the iothread disk support from pci to pci and ccw.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
Boris Fiuczynski 2014-11-06 15:04:05 +01:00 committed by Martin Kletzander
parent 8402be5c10
commit b84be34f43
6 changed files with 60 additions and 5 deletions

View File

@ -509,9 +509,9 @@
<dd>
The content of this optional element defines the number
of IOThreads to be assigned to the domain for use by
virtio-blk-pci target storage devices. There should be
only 1 or 2 IOThreads per host CPU. There may be more than
supported device assigned to each IOThread.
virtio-blk-pci and virtio-blk-ccw target storage devices. There
should be only 1 or 2 IOThreads per host CPU. There may be more
than one supported device assigned to each IOThread.
</dd>
</dl>

View File

@ -3738,9 +3738,11 @@ qemuCheckIothreads(virDomainDefPtr def,
/* Right "type" of disk" */
if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO ||
disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
(disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("IOThreads only available for virtio pci disk"));
_("IOThreads only available for virtio pci and "
"virtio ccw disk"));
return false;
}
@ -3952,6 +3954,8 @@ qemuBuildDriveDevStr(virDomainDefPtr def,
case VIR_DOMAIN_DISK_BUS_VIRTIO:
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
virBufferAddLit(&opt, "virtio-blk-ccw");
if (disk->iothread)
virBufferAsprintf(&opt, ",iothread=iothread%u", disk->iothread);
} else if (disk->info.type ==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) {
virBufferAddLit(&opt, "virtio-blk-s390");

View File

@ -0,0 +1,14 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu -S \
-M s390-ccw -m 214 -smp 1 \
-object iothread,id=iothread1 \
-object iothread,id=iothread2 \
-nographic -nodefaults \
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
-device virtio-blk-ccw,iothread=iothread1,devno=fe.0.0000,\
drive=drive-virtio-disk0,id=virtio-disk0 \
-drive file=/dev/HostVG/QEMUGuest2,if=none,id=drive-virtio-disk1 \
-device virtio-blk-ccw,iothread=iothread2,devno=0.0.0007,\
drive=drive-virtio-disk1,id=virtio-disk1 \
-device virtio-balloon-ccw,id=balloon0,devno=fe.0.000a

View File

@ -0,0 +1,34 @@
<domain type='qemu'>
<name>QEMUGuest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219136</memory>
<currentMemory unit='KiB'>219136</currentMemory>
<vcpu placement='static'>1</vcpu>
<iothreads>2</iothreads>
<os>
<type arch='s390x' machine='s390-ccw'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu</emulator>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' iothread='1'/>
<source dev='/dev/HostVG/QEMUGuest1'/>
<target dev='hda' bus='virtio'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' iothread='2'/>
<source dev='/dev/HostVG/QEMUGuest2'/>
<target dev='hdb' bus='virtio'/>
<address type='ccw' cssid='0x0' ssid='0x0' devno='0x0007'/>
</disk>
<controller type='usb' index='0' model='none'/>
<memballoon model='virtio'>
<address type='ccw' cssid='0xfe' ssid='0x0' devno='0x000a'/>
</memballoon>
</devices>
</domain>

View File

@ -1205,6 +1205,8 @@ mymain(void)
DO_TEST("iothreads", QEMU_CAPS_OBJECT_IOTHREAD);
DO_TEST("iothreads-disk", QEMU_CAPS_OBJECT_IOTHREAD, QEMU_CAPS_DEVICE,
QEMU_CAPS_DRIVE);
DO_TEST("iothreads-disk-virtio-ccw", QEMU_CAPS_OBJECT_IOTHREAD, QEMU_CAPS_DEVICE,
QEMU_CAPS_DRIVE, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
DO_TEST("cpu-topology1", QEMU_CAPS_SMP_TOPOLOGY);
DO_TEST("cpu-topology2", QEMU_CAPS_SMP_TOPOLOGY);

View File

@ -306,6 +306,7 @@ mymain(void)
DO_TEST("iothreads");
DO_TEST_DIFFERENT("cputune-iothreads");
DO_TEST("iothreads-disk");
DO_TEST("iothreads-disk-virtio-ccw");
DO_TEST("lease");
DO_TEST("event_idx");
DO_TEST("vhost_queues");