]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: snapshot: Don't clear current snapshot when redefining an existing one
authorPeter Krempa <pkrempa@redhat.com>
Tue, 1 Oct 2019 05:22:14 +0000 (07:22 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 24 Oct 2019 17:35:34 +0000 (19:35 +0200)
There's no point in clearing the current snapshot when we are just
changing the definition of the current snapshot as by the virtue of the
'update_current' flag the same snapshot would become current in
qemuDomainSnapshotCreateXML.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/snapshot_conf.c

index 9f08965aab0ebed67550ef217003e0f1f65e182f..f280202c960b2b2c5a00a52f3d89183744aea5b0 100644 (file)
@@ -983,7 +983,7 @@ virDomainSnapshotRedefinePrep(virDomainObjPtr vm,
                               virDomainSnapshotDefPtr *defptr,
                               virDomainMomentObjPtr *snap,
                               virDomainXMLOptionPtr xmlopt,
-                              bool *update_current,
+                              bool *update_current G_GNUC_UNUSED,
                               unsigned int flags)
 {
     virDomainSnapshotDefPtr def = *defptr;
@@ -1006,11 +1006,6 @@ virDomainSnapshotRedefinePrep(virDomainObjPtr vm,
         return -1;
     }
     if (other) {
-        if (other == virDomainSnapshotGetCurrent(vm->snapshots)) {
-            *update_current = true;
-            virDomainSnapshotSetCurrent(vm->snapshots, NULL);
-        }
-
         /* Drop and rebuild the parent relationship, but keep all
          * child relations by reusing snap. */
         virDomainMomentDropParent(other);