From: Boris Fiuczynski Date: Thu, 6 Nov 2014 14:04:05 +0000 (+0100) Subject: qemu: Allow use of iothreads for virtio ccw disk definitions X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b84be34f434c1f92aed9057ad4b99d106b604e46;p=libvirt.git 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 Reviewed-by: Viktor Mihajlovski Reviewed-by: Christian Borntraeger --- diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0099ce7f46..ffc35a2a50 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -509,9 +509,9 @@
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.
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 058c2212cf..b148d45360 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -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"); diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.args new file mode 100644 index 0000000000..d6c5c150ba --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.args @@ -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 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.xml b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.xml new file mode 100644 index 0000000000..242ea8aab3 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-disk-virtio-ccw.xml @@ -0,0 +1,34 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + 2 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + + + + + + + +
+ + + +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index abdf516a0e..63e61bd274 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -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); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 0ec4303887..ca11e90ebb 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -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");