OSDN Git Service

qemu-img bench: Fix uninitialised writethrough mode
authorKevin Wolf <kwolf@redhat.com>
Tue, 14 Jun 2016 09:29:32 +0000 (11:29 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 16 Jun 2016 13:19:55 +0000 (15:19 +0200)
If no -t option is specified, bool writethrough stayed uninitialised.
Initialise it as false, which makes cache=writeback the default cache
mode.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-img.c

index 251386b..14e2661 100644 (file)
@@ -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;