Skip to contentSkip to conversation

qemu-img bench: Fix uninitialised writethrough mode

PATCH In review Kevin Wolf 3 participants 3 messages Jun 14, 2016 – Jun 16, 2016

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 qemu-img bench: Fix uninitialised writethrough mode

If no -t option is specified, bool writethrough stayed uninitialised. Initialise it as false, which makes cache=writeback the default cache mode.

---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-img.c +1 -1
index 251386b..14e2661 100644
@@ -3570,7 +3570,7 @@ static int img_bench(int argc, char **argv)
     BlockBackend *blk = NULL;
     BenchData data = {};
     int flags = 0;
-    bool writethrough;
+    bool writethrough = false;
     struct timeval t1, t2;
     int i;
 
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Kevin Wolf

If no -t option is specified, bool writethrough stayed uninitialised. Initialise it as false, which makes cache=writeback the default cache mode.

---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)