qemu: Setup host side of VDPA device for block copy

Setup the VDPA bits of the appropriate part of the image chain for block
copy.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-10-26 15:44:34 +02:00
parent 98dd641e86
commit 9ca910488c
2 changed files with 16 additions and 0 deletions

View File

@ -23,6 +23,7 @@
#include "qemu_domain.h" #include "qemu_domain.h"
#include "qemu_alias.h" #include "qemu_alias.h"
#include "qemu_security.h" #include "qemu_security.h"
#include "qemu_process.h"
#include "storage_source.h" #include "storage_source.h"
#include "viralloc.h" #include "viralloc.h"
@ -3675,6 +3676,9 @@ qemuBlockPivot(virDomainObj *vm,
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY) && virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY) &&
virStorageSourceHasBacking(disk->mirror)) { virStorageSourceHasBacking(disk->mirror)) {
if (qemuProcessPrepareHostStorageSourceChain(vm, disk->mirror->backingStore) < 0)
return -1;
if (!(chainattachdata = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->mirror->backingStore))) if (!(chainattachdata = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->mirror->backingStore)))
return -1; return -1;

View File

@ -14290,10 +14290,16 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY)) { if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY)) {
g_autoptr(virStorageSource) terminator = virStorageSourceNew(); g_autoptr(virStorageSource) terminator = virStorageSourceNew();
if (qemuProcessPrepareHostStorageSource(vm, mirror) < 0)
goto endjob;
if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror, if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror,
terminator))) terminator)))
goto endjob; goto endjob;
} else { } else {
if (qemuProcessPrepareHostStorageSourceChain(vm, mirror) < 0)
goto endjob;
if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror))) if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror)))
goto endjob; goto endjob;
} }
@ -14308,6 +14314,9 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
if (mirror_shallow) { if (mirror_shallow) {
/* if external backing store is populated we'll need to open it */ /* if external backing store is populated we'll need to open it */
if (virStorageSourceHasBacking(mirror)) { if (virStorageSourceHasBacking(mirror)) {
if (qemuProcessPrepareHostStorageSourceChain(vm, mirror->backingStore) < 0)
goto endjob;
if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror->backingStore))) if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror->backingStore)))
goto endjob; goto endjob;
@ -14321,6 +14330,9 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
mirrorBacking = mirror->backingStore; mirrorBacking = mirror->backingStore;
} }
if (qemuProcessPrepareHostStorageSource(vm, mirror) < 0)
goto endjob;
if (!(crdata = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror, if (!(crdata = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror,
mirrorBacking))) mirrorBacking)))
goto endjob; goto endjob;