Setup the VDPA bits of the appropriate part of the image chain for block copy. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_block.c | 4 ++++ src/qemu/qemu_driver.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 41038fb994..42c12a5e9b 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -23,6 +23,7 @@ #include "qemu_domain.h" #include "qemu_alias.h" #include "qemu_security.h" +#include "qemu_process.h" #include "storage_source.h" #include "viralloc.h" @@ -3675,6 +3676,9 @@ qemuBlockPivot(virDomainObj *vm, virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY) && virStorageSourceHasBacking(disk->mirror)) { + if (qemuProcessPrepareHostStorageSourceChain(vm, disk->mirror->backingStore) < 0) + return -1; + if (!(chainattachdata = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->mirror->backingStore))) return -1; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 86da8da777..d00d2a27c6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14290,10 +14290,16 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY)) { g_autoptr(virStorageSource) terminator = virStorageSourceNew(); + if (qemuProcessPrepareHostStorageSource(vm, mirror) < 0) + goto endjob; + if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror, terminator))) goto endjob; } else { + if (qemuProcessPrepareHostStorageSourceChain(vm, mirror) < 0) + goto endjob; + if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror))) goto endjob; } @@ -14308,6 +14314,9 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, if (mirror_shallow) { /* if external backing store is populated we'll need to open it */ if (virStorageSourceHasBacking(mirror)) { + if (qemuProcessPrepareHostStorageSourceChain(vm, mirror->backingStore) < 0) + goto endjob; + if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror->backingStore))) goto endjob; @@ -14321,6 +14330,9 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, mirrorBacking = mirror->backingStore; } + if (qemuProcessPrepareHostStorageSource(vm, mirror) < 0) + goto endjob; + if (!(crdata = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror, mirrorBacking))) goto endjob; -- 2.41.0