mirror of https://gitee.com/openkylin/libvirt.git
qemu: Enable ioeventfd usage for virtio-scsi controllers
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1150484 Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
35eecddee3
commit
cf0404455c
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue