qemu: Implement the aio mode io_uring

This aio mode was added since Linux 5.1[1], QEMU 5.0.0[2], which will
deliever faster and more efficient I/O operations for the file,
host_device, host_cdrom backends.

Reference:
[1]: https://lwn.net/Articles/810414/
[2]: https://lists.gnu.org/archive/html/qemu-devel/2020-01/msg07686.html

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Han Han 2020-04-21 20:19:35 +08:00 committed by Peter Krempa
parent cbdd6c4df4
commit 4e30afafa7
3 changed files with 10 additions and 0 deletions

View File

@ -375,6 +375,7 @@ VIR_ENUM_IMPL(virDomainDiskIo,
"default",
"native",
"threads",
"io_uring",
);
VIR_ENUM_IMPL(virDomainDeviceSGIO,

View File

@ -421,6 +421,7 @@ typedef enum {
VIR_DOMAIN_DISK_IO_DEFAULT = 0,
VIR_DOMAIN_DISK_IO_NATIVE,
VIR_DOMAIN_DISK_IO_THREADS,
VIR_DOMAIN_DISK_IO_URING,
VIR_DOMAIN_DISK_IO_LAST
} virDomainDiskIo;

View File

@ -1435,6 +1435,14 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk,
_("detect_zeroes is not supported by this QEMU binary"));
return -1;
}
if (disk->iomode == VIR_DOMAIN_DISK_IO_URING) {
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AIO_IO_URING)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("io uring is not supported by this QEMU binary"));
return -1;
}
}
}
if (disk->serial &&