]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: checkpoint: Don't clear current checkpoint when redefining
authorPeter Krempa <pkrempa@redhat.com>
Tue, 1 Oct 2019 06:10:18 +0000 (08:10 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 24 Oct 2019 17:35:34 +0000 (19:35 +0200)
If we are updating the current checkpoint when redefining by mentioning
the current checkpoint as a parent of the newly redefined one we don't
have to clear it first.

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

index 71eac76a1531ca41d5be9e7789003c5ceab953af..5b2723332decec2c8157ee77cd73e395faaa0a4a 100644 (file)
@@ -556,10 +556,8 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
     if (def->parent.parent_name &&
          (parent = virDomainCheckpointFindByName(vm->checkpoints,
                                                  def->parent.parent_name))) {
-        if (parent == virDomainCheckpointGetCurrent(vm->checkpoints)) {
+        if (parent == virDomainCheckpointGetCurrent(vm->checkpoints))
             *update_current = true;
-            virDomainCheckpointSetCurrent(vm->checkpoints, NULL);
-        }
     }
 
     other = virDomainCheckpointFindByName(vm->checkpoints, def->parent.name);