]> git.proxmox.com Git - qemu.git/commitdiff
qcow2: Really use cache=unsafe for image creation
authorKevin Wolf <kwolf@redhat.com>
Thu, 27 Jan 2011 15:46:01 +0000 (16:46 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 7 Feb 2011 08:44:22 +0000 (09:44 +0100)
For cache=unsafe we also need to set BDRV_O_CACHE_WB, otherwise we have some
strange unsafe writethrough mode.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
block/qcow2.c

index dbe4fdd44d69e658cf953163f8a498cb13cf971e..a1773e4790f35e761aa895cff3ba4905a920d15b 100644 (file)
@@ -975,7 +975,8 @@ static int qcow2_create2(const char *filename, int64_t total_size,
      */
     BlockDriver* drv = bdrv_find_format("qcow2");
     assert(drv != NULL);
-    ret = bdrv_open(bs, filename, BDRV_O_RDWR | BDRV_O_NO_FLUSH, drv);
+    ret = bdrv_open(bs, filename,
+        BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH, drv);
     if (ret < 0) {
         goto out;
     }