[PATCH 03/14] qemuSnapshotCreateAlignDisks: Rewrite logic for selecting default memory snapshot mode

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

 



Use an if/else branch rather than a expression with a ternary operator.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_snapshot.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index f92b571b06..355a2fd782 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1672,9 +1672,10 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
             return -1;
         }

-        def->memory = (def->state == VIR_DOMAIN_SNAPSHOT_SHUTOFF ?
-                       VIR_DOMAIN_SNAPSHOT_LOCATION_NONE :
-                       VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL);
+        if (def->state == VIR_DOMAIN_SNAPSHOT_SHUTOFF)
+            def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
+        else
+            def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
     }
     if (virDomainSnapshotAlignDisks(def, NULL, align_location, true) < 0)
         return -1;
-- 
2.35.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