[PATCH 08/11] qemu: driver: Remove disk source munging in qemuDomainBlockPivot

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

 



Previously there weren't any suitable functions which would allow
setting up host side of a full disk chain so we've opted to replace the
'src' in a virDomainDiskDef by the new image source.

That is now no longer necessary so remove the munging.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 025acec6af..79a767288e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17144,7 +17144,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
 {
     int ret = -1;
     qemuDomainObjPrivatePtr priv = vm->privateData;
-    virStorageSourcePtr oldsrc = NULL;
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);

     if (!disk->mirror) {
@@ -17180,21 +17179,15 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
      * has already been labeled; but only necessary when we know for
      * sure that there is a backing chain.  */
     if (disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY) {
-        oldsrc = disk->src;
-        disk->src = disk->mirror;
-
         if (qemuDomainDetermineDiskChain(driver, vm, disk, disk->mirror, true) < 0)
             goto cleanup;

         if (disk->mirror->format &&
             disk->mirror->format != VIR_STORAGE_FILE_RAW &&
-            (qemuDomainNamespaceSetupDisk(vm, disk->src) < 0 ||
-             qemuSetupImageChainCgroup(vm, disk->src) < 0 ||
-             qemuSecuritySetImageLabel(driver, vm, disk->src, true) < 0))
+            (qemuDomainNamespaceSetupDisk(vm, disk->mirror) < 0 ||
+             qemuSetupImageChainCgroup(vm, disk->mirror) < 0 ||
+             qemuSecuritySetImageLabel(driver, vm, disk->mirror, true) < 0))
             goto cleanup;
-
-        disk->src = oldsrc;
-        oldsrc = NULL;
     }

     /* Attempt the pivot.  Record the attempt now, to prevent duplicate
@@ -17222,9 +17215,6 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
     }

  cleanup:
-    if (oldsrc)
-        disk->src = oldsrc;
-
     virObjectUnref(cfg);
     return ret;
 }
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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