From patchwork Mon Feb 7 12:46:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 82237 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C8DFDB70FF for ; Tue, 8 Feb 2011 10:41:01 +1100 (EST) Received: from localhost ([127.0.0.1]:39565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmQxv-00067E-7n for incoming@patchwork.ozlabs.org; Mon, 07 Feb 2011 08:17:15 -0500 Received: from [140.186.70.92] (port=36814 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmQSf-0008Dm-Ei for qemu-devel@nongnu.org; Mon, 07 Feb 2011 07:44:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmQSc-0001Tl-DL for qemu-devel@nongnu.org; Mon, 07 Feb 2011 07:44:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmQSc-0001TY-0k for qemu-devel@nongnu.org; Mon, 07 Feb 2011 07:44:54 -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.14.4/8.14.4) with ESMTP id p17CiqiK009048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Feb 2011 07:44:52 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p17Cin3v027395; Mon, 7 Feb 2011 07:44:51 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 7 Feb 2011 13:46:23 +0100 Message-Id: <1297082796-1369-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1297082796-1369-1-git-send-email-kwolf@redhat.com> References: <1297082796-1369-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [STABLE 0.14][PATCH 01/14] qcow2: Really use cache=unsafe for image creation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Stefan Hajnoczi (cherry picked from commit e1a7107f2d92af646ec37b74d074dc150e688559) --- 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; }