From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39396 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiU5F-0005Ef-OJ for qemu-devel@nongnu.org; Thu, 27 Jan 2011 10:48:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiU5E-0000Kp-5N for qemu-devel@nongnu.org; Thu, 27 Jan 2011 10:48:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiU5D-0000KL-RA for qemu-devel@nongnu.org; Thu, 27 Jan 2011 10:48:28 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0RFmQoN023447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 27 Jan 2011 10:48:27 -0500 From: Kevin Wolf Date: Thu, 27 Jan 2011 16:50:02 +0100 Message-Id: <1296143402-13274-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] qcow2: Really use cache=unsafe for image creation List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com 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 --- block/qcow2.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index dbe4fdd..a1773e4 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -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; } -- 1.7.2.3