From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCQfR-00078E-3O for qemu-devel@nongnu.org; Fri, 14 Sep 2012 03:50:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCQfL-0006gw-Ai for qemu-devel@nongnu.org; Fri, 14 Sep 2012 03:50:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCQfL-0006gK-24 for qemu-devel@nongnu.org; Fri, 14 Sep 2012 03:50:19 -0400 Message-ID: <5052E1B2.2080304@redhat.com> Date: Fri, 14 Sep 2012 09:50:10 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <01df3140216ac0398bfb3a295c553c42cdf31e5b.1347548248.git.jcody@redhat.com> <5052060A.5010304@redhat.com> <5052DC5C.4080907@redhat.com> In-Reply-To: <5052DC5C.4080907@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 06/16] block: do not parse BDRV_O_CACHE_WB in raw block drivers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: supriyak@linux.vnet.ibm.com, Jeff Cody , eblake@redhat.com, qemu-devel@nongnu.org, stefanha@gmail.com Il 14/09/2012 09:27, Kevin Wolf ha scritto: > I can't see how bs->file is needed here for writethrough semantics. > bdrv_open_common() sets bs->enable_write_cache to false and > bdrv_co_do_writev() checks it and flushes if necessary. Looks fine to me. You're right. > In fact, bdrv_open_common() even removes BDRV_O_CACHE_WB, so what Jeff > removes here is really dead code (checked with strace: The file isn't > opened with O_SYNC even when using -drive format=file). Yes, it's dead, on the other hand we still honor BDRV_O_CACHE_WB in all the other protocols. Either we go and touch all the protocols (effectively removing BDRV_O_CACHE_WB from the BlockDriver specification), or treating raw-{posix,win32} specially means we leave bugs everywhere else. Paolo