Re: [PATCH 2/2] virDomainCheckpointRedefinePrep: Set 'current' checkpoint if there isn't any

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

 



On 4/1/20 8:10 AM, Peter Krempa wrote:
When redefining checkpoints from scratch we'd not set the 'current'
checkpoint if there wasn't any. This meant that the code wasn't ever
able to set a 'current' checkpoint as any other one looks up if the
parent of the redefined checkpoint is current.

Since the backup code then requires the current checkpoint to start the
lookup we'd not be able to perform a backup after restoring the
checkpoint hierarchy.

Reported-by: Eyal Shenitzky <eshenitz@xxxxxxxxxx>
Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
  src/conf/checkpoint_conf.c | 4 ++++
  1 file changed, 4 insertions(+)

Reviewed-by: Eric Blake <eblake@xxxxxxxxxx>


diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c
index 26bcfc16b7..d557fada49 100644
--- a/src/conf/checkpoint_conf.c
+++ b/src/conf/checkpoint_conf.c
@@ -550,6 +550,10 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
              *update_current = true;
      }

+    /* set the first redefined checkpoint as current */
+    if (virDomainCheckpointGetCurrent(vm->checkpoints) == NULL)
+        *update_current = true;
+
      other = virDomainCheckpointFindByName(vm->checkpoints, def->parent.name);
      if (other) {
          otherdef = virDomainCheckpointObjGetDef(other);


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




[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