[libvirt RFC 16/24] qemu_snapshot: pass update_parent into qemuSnapshotDiscardMetadata

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

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/qemu/qemu_snapshot.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index cbacb05c16..787186605f 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -2284,11 +2284,12 @@ qemuSnapshotChildrenReparent(void *payload,
 static int
 qemuSnapshotDiscardMetadata(virDomainObj *vm,
                             virDomainMomentObj *snap,
-                            virQEMUDriver *driver)
+                            virQEMUDriver *driver,
+                            bool update_parent)
 {
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
 
-    if (snap->nchildren) {
+    if (update_parent && snap->nchildren) {
         virQEMUMomentReparent rep;
 
         rep.dir = cfg->snapshotDir;
@@ -2351,10 +2352,8 @@ qemuSnapshotDiscard(virQEMUDriver *driver,
         }
     }
 
-    if (update_parent &&
-        qemuSnapshotDiscardMetadata(vm, snap, driver) < 0) {
+    if (qemuSnapshotDiscardMetadata(vm, snap, driver, update_parent) < 0)
         return -1;
-    }
 
     snapFile = g_strdup_printf("%s/%s/%s.xml", cfg->snapshotDir, vm->def->name,
                                snap->def->name);
-- 
2.37.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