[PATCH 1/3] qemuSnapshotForEachQcow2: Don't initialize 'nrollback'

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

 



The variable holds the amount of disks to roll back the snapshot for.
The value must be set before the code jumps to the 'rollback:' label so
the best situation is to not initialize it and let the compiler catch
errors rather than initialize the unsigned variable to -1 and let it
crash.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_snapshot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 7ce018b026..e5226db942 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -290,7 +290,7 @@ qemuSnapshotForEachQcow2(virDomainDef *def,
     size_t i;
     bool skipped = false;
     bool create = STREQ(op, "-c");
-    size_t nrollback = -1;
+    size_t nrollback;
     virErrorPtr orig_err;

     /* pre-checks */
-- 
2.48.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