[libvirt PATCH 04/11] qemu_snapshot: create: move virDomainSnapshotAssignDef to both code paths

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

 



This makes it obvious that the function is called for creating new
snapshot and redefining old snapshot as well.

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

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 7198a2aad3..6860133bbb 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1761,15 +1761,18 @@ qemuSnapshotCreateXML(virDomainPtr domain,
                                           driver->xmlopt,
                                           flags) < 0)
             goto endjob;
+
+        if (!snap) {
+            if (!(snap = virDomainSnapshotAssignDef(vm->snapshots, def)))
+                goto endjob;
+        }
     } else {
         if (qemuSnapshotAlignDisks(vm, def, driver, flags) < 0)
             goto endjob;
 
         if (qemuSnapshotPrepare(vm, def, &flags) < 0)
             goto endjob;
-    }
 
-    if (!snap) {
         if (!(snap = virDomainSnapshotAssignDef(vm->snapshots, def)))
             goto endjob;
 
-- 
2.31.1




[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