From: Peter Krempa Date: Wed, 1 Apr 2020 12:34:15 +0000 (+0200) Subject: virDomainCheckpointRedefinePrep: Set 'current' checkpoint if there isn't any X-Git-Tag: v6.3.0-rc1~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9428c4609c7b23b3afe89566dca9ac237256d3df;p=thirdparty%2Flibvirt.git virDomainCheckpointRedefinePrep: Set 'current' checkpoint if there isn't any 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 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- 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);