[PATCH v2 3/3] qemu: Setup host side of VDPA device for block copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux