[libvirt PATCH 06/11] qemu_snapshot: create: drop update_current variable

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

 



There is no need for the extra variable as it is used only at one place.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/qemu/qemu_snapshot.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 9a3f90e346..ac57d4e90e 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1703,7 +1703,6 @@ qemuSnapshotCreateXML(virDomainPtr domain,
     virQEMUDriver *driver = domain->conn->privateData;
     virDomainMomentObj *snap = NULL;
     virDomainSnapshotPtr snapshot = NULL;
-    bool update_current = true;
     bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE;
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
     g_autoptr(virDomainSnapshotDef) def = NULL;
@@ -1726,10 +1725,6 @@ qemuSnapshotCreateXML(virDomainPtr domain,
                             VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE,
                             NULL);
 
-    if ((redefine && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)) ||
-        (flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA))
-        update_current = false;
-
     if (qemuDomainSupportsCheckpointsBlockjobs(vm) < 0)
         return NULL;
 
@@ -1824,7 +1819,7 @@ qemuSnapshotCreateXML(virDomainPtr domain,
 
  endjob:
     if (snapshot && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) {
-        if (update_current)
+        if (!redefine || (flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT))
             qemuSnapshotSetCurrent(vm, snap);
 
         if (qemuDomainSnapshotWriteMetadata(vm, snap,
-- 
2.31.1




[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