[libvirt] [PATCH RFC 17/40] conf: snapshot: Don't clear current snapshot when redefining an existing one

Peter Krempa posted 40 patches 6 years, 2 months ago
[libvirt] [PATCH RFC 17/40] conf: snapshot: Don't clear current snapshot when redefining an existing one
Posted by Peter Krempa 6 years, 2 months ago
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>
---
 src/conf/snapshot_conf.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 0e9d307321..ec47e14955 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -989,7 +989,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;
@@ -1012,11 +1012,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);
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH RFC 17/40] conf: snapshot: Don't clear current snapshot when redefining an existing one
Posted by Ján Tomko 6 years, 1 month ago
On Fri, Oct 18, 2019 at 06:11:02PM +0200, Peter Krempa wrote:
>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>
>---
> src/conf/snapshot_conf.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
>diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
>index 0e9d307321..ec47e14955 100644
>--- a/src/conf/snapshot_conf.c
>+++ b/src/conf/snapshot_conf.c
>@@ -989,7 +989,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;

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list