From: Peter Krempa Date: Tue, 1 Oct 2019 05:22:14 +0000 (+0200) Subject: conf: snapshot: Don't clear current snapshot when redefining an existing one X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=551dde92562afc5a5501d8e38dceae5d91a59d2d;p=libvirt.git conf: snapshot: Don't clear current snapshot when redefining an existing one 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 Reviewed-by: Ján Tomko --- diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 9f08965aab..f280202c96 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -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);