[PATCH 2/5] qemu: backup: Initialize 'store' source properly and just once

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

 



Two functions called in sequence both initialized the virStorageSource
backing 'store' leading to a memleak.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_backup.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index 531005425b..43fe8942ad 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -272,9 +272,6 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm,
         dd->backingStore = dd->terminator = virStorageSourceNew();
     }

-    if (qemuDomainStorageFileInit(priv->driver, vm, dd->store, dd->domdisk->src) < 0)
-        return -1;
-
     if (qemuDomainPrepareStorageSourceBlockdev(NULL, dd->store, priv, cfg) < 0)
         return -1;

@@ -410,7 +407,7 @@ qemuBackupDiskPrepareOneStorage(virDomainObjPtr vm,
             return -1;
         }

-        if (qemuDomainStorageFileInit(priv->driver, vm, dd->store, NULL) < 0)
+        if (qemuDomainStorageFileInit(priv->driver, vm, dd->store, dd->domdisk->src) < 0)
             return -1;

         dd->initialized = true;
-- 
2.26.2




[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