From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43584 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PznPd-0000bI-3t for qemu-devel@nongnu.org; Wed, 16 Mar 2011 05:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PznPX-0001Xg-Ll for qemu-devel@nongnu.org; Wed, 16 Mar 2011 05:53:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PznPX-0001XT-Aw for qemu-devel@nongnu.org; Wed, 16 Mar 2011 05:52:59 -0400 Message-ID: <4D8088F8.1020708@redhat.com> Date: Wed, 16 Mar 2011 10:55:04 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <20110315141049.GA30627@lst.de> <20110315141100.GA30710@lst.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: "prerna@linux.vnet.ibm.com Anthony Liguori" , Christoph Hellwig , qemu-devel@nongnu.org Am 16.03.2011 10:42, schrieb Stefan Hajnoczi: > On Tue, Mar 15, 2011 at 2:11 PM, Christoph Hellwig wrote: >> Change BDRV_O_NOCACHE to only imply bypassing the host OS file cache, >> but no writeback semantics. All existing callers are changed to also >> specify BDRV_O_CACHE_WB to give them writeback semantics. >> >> Signed-off-by: Christoph Hellwig > > I think there is one hunk missing: > diff --git a/block/qcow2.c b/block/qcow2.c > index 75b8bec..db1931b 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c > @@ -229,7 +229,7 @@ static int qcow2_open(BlockDriverState *bs, int flags) > } > > /* alloc L2 table/refcount block cache */ > - writethrough = ((flags & BDRV_O_CACHE_MASK) == 0); > + writethrough = ((flags & (BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH)) == 0); > s->l2_table_cache = qcow2_cache_create(bs, L2_CACHE_SIZE, writethrough); > s->refcount_block_cache = qcow2_cache_create(bs, REFCOUNT_CACHE_SIZE, > writethrough); This one doesn't make a difference. But the intention could be made clearer now that all writeback modes have BDRV_O_CACHE_WB set: writethrough = ((flags & BDRV_O_CACHE_WB) == 0); Kevin