]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Enable ioeventfd usage for virtio-scsi controllers
authorMartin Kletzander <mkletzan@redhat.com>
Sun, 26 Jul 2015 18:41:34 +0000 (20:41 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Mon, 10 Aug 2015 13:05:34 +0000 (15:05 +0200)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1150484

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args [new file with mode: 0644]
tests/qemuxml2argvtest.c

index e12278c7b4fe48d54672a1664844abb63f2a2e0a..87468ca26fdb3cd8abdddd8008f538b80d2f90f7 100644 (file)
@@ -4611,6 +4611,11 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
                            _("'max_sectors' is only supported by virtio-scsi controller"));
             return NULL;
         }
+        if (def->ioeventfd) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("'ioeventfd' is only supported by virtio-scsi controller"));
+            return NULL;
+        }
     }
 
     switch (def->type) {
@@ -4909,6 +4914,8 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
     if (def->max_sectors)
         virBufferAsprintf(&buf, ",max_sectors=%u", def->max_sectors);
 
+    qemuBuildIoEventFdStr(&buf, def->ioeventfd, qemuCaps);
+
     if (qemuBuildDeviceAddressStr(&buf, domainDef, &def->info, qemuCaps) < 0)
         goto error;
 
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-scsi-ioeventfd.args
new file mode 100644 (file)
index 0000000..1c53189
--- /dev/null
@@ -0,0 +1,9 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M pc -m 214 -smp 8 -nographic -nodefconfig -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
+-device virtio-scsi-pci,id=scsi0,ioeventfd=on,bus=pci.0,addr=0x3 \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-scsi0-0-0-0 \
+-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
+drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
index 7c37e114f34a7557a6518f5777dbebe5c5123fac..c2482e61244852b928487a25aec90153c017a6a9 100644 (file)
@@ -878,6 +878,9 @@ mymain(void)
     DO_TEST("disk-virtio-scsi-max_sectors",
             QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_VIRTIO_SCSI);
+    DO_TEST("disk-virtio-scsi-ioeventfd",
+            QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_VIRTIO_IOEVENTFD, QEMU_CAPS_VIRTIO_SCSI);
     DO_TEST("disk-scsi-megasas",
             QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_SCSI_MEGASAS);