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>
<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>
/* 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;
}
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");
--- /dev/null
+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
--- /dev/null
+<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>
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);
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");