From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXAPQ-0005xg-6z for qemu-devel@nongnu.org; Wed, 23 May 2012 08:11:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXAPJ-0001TX-L0 for qemu-devel@nongnu.org; Wed, 23 May 2012 08:11:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXAPJ-0001SO-Bb for qemu-devel@nongnu.org; Wed, 23 May 2012 08:11:13 -0400 Message-ID: <4FBCD3D6.3060407@redhat.com> Date: Wed, 23 May 2012 14:11:02 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1337350712-29183-1-git-send-email-pbonzini@redhat.com> <1337350712-29183-4-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH 3/7] block: do not pass BDRV_O_CACHE_WB to the protocol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, stefanha@linux.vnet.ibm.com Il 23/05/2012 14:06, Stefan Hajnoczi ha scritto: >> > diff --git a/block.c b/block.c >> > index 3db7150..b3d0054 100644 >> > --- a/block.c >> > +++ b/block.c >> > @@ -661,7 +661,7 @@ static int bdrv_open_common(BlockDriverState *bs, const char *filename, >> > if (drv->bdrv_file_open) { >> > ret = drv->bdrv_file_open(bs, filename, open_flags); >> > } else { >> > - ret = bdrv_file_open(&bs->file, filename, open_flags); >> > + ret = bdrv_file_open(&bs->file, filename, open_flags & ~BDRV_O_CACHE_WB); > Do you really want to open image files with O_DSYNC? For example, > when I try these patches with -drive > if=virtio,file=test.img,cache=none I find that the image file file > descriptor has O_DSYNC set! That would make cache=none equivalent to > cache=directsync. See the revised version I posted yesterday, this patch is bonkers. :) What I wanted is "| BDRV_O_CACHE_WB". Paolo