On Wed, Feb 03, 2021 at 16:25:59 +0100, Pavel Hrdina wrote:
Implements QEMU support for vhost-user-blk together with live
hotplug/unplug.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
Changes in v2:
- moved check for vhostuser in qemuDomainPrepareDiskSource
- added hot-unplug support
- disable blockjobs in qemuDomainDiskBlockJobIsSupported
- error out in qemuDomainSetBlockIoTune and qemuDomainGetBlockIoTune
- print proper error in qemuDomainBlockPeek,
qemuDomainSetBlockThreshold, qemuDomainGetBlockInfo,
qemuDomainBlockResize
- correctly handle qemuDomainBlockStats(Flags) and
qemuDomainGetStatsBlockExportDisk
src/qemu/qemu_block.c | 42 +++++++++
src/qemu/qemu_block.h | 7 ++
src/qemu/qemu_command.c | 91 +++++++++++++++++--
src/qemu/qemu_command.h | 8 ++
src/qemu/qemu_domain.c | 12 +++
src/qemu/qemu_driver.c | 72 +++++++++++++++
src/qemu/qemu_hotplug.c | 14 ++-
src/qemu/qemu_validate.c | 13 +++
.../disk-vhostuser.x86_64-latest.args | 41 +++++++++
tests/qemuxml2argvtest.c | 1 +
10 files changed, 290 insertions(+), 11 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-vhostuser.x86_64-latest.args
[...]
@@ -10296,6 +10315,38 @@
qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk,
}
+/**
+ * qemuBuildStorageSourceAttachPrepareChardev:
+ * @src: disk source to prepare
+ *
+ * Prepare qemuBlockStorageSourceAttachDataPtr for use with -chardev.
Mention vhost-user, that's more important than -chardev.
+ */
+qemuBlockStorageSourceAttachDataPtr
+qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDefPtr disk)
+{
[...]
* @src: storage source
@@ -10378,6 +10429,30 @@
qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk,
}
+/**
+ * qemuBuildStorageSourceChainAttachPrepareChardev:
+ * @src: disk definition
+ *
+ * Prepares qemuBlockStorageSourceChainDataPtr for attaching @disk via -drive.
for attaching a vhost-user disk's backend via -chardev
+ */
+qemuBlockStorageSourceChainDataPtr
+qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDefPtr disk)
+{
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>