From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JycfD-0001We-U9 for qemu-devel@nongnu.org; Tue, 20 May 2008 20:58:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JycfC-0001Vz-Cy for qemu-devel@nongnu.org; Tue, 20 May 2008 20:58:43 -0400 Received: from [199.232.76.173] (port=56560 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JycfC-0001Vt-80 for qemu-devel@nongnu.org; Tue, 20 May 2008 20:58:42 -0400 Received: from yw-out-1718.google.com ([74.125.46.152]:25130) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JycfC-0006LM-05 for qemu-devel@nongnu.org; Tue, 20 May 2008 20:58:42 -0400 Received: by yw-out-1718.google.com with SMTP id 6so1609630ywa.82 for ; Tue, 20 May 2008 17:58:41 -0700 (PDT) Message-ID: <483373BA.6090108@codemonkey.ws> Date: Tue, 20 May 2008 19:58:34 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH][v2] Align file accesses with cache=off (O_DIRECT) References: <1211283126.4314.70.camel@frecb07144> <48332AB9.3010707@codemonkey.ws> <20080520223602.GE27853@shareable.org> <200805202352.17807.paul@codesourcery.com> In-Reply-To: <200805202352.17807.paul@codesourcery.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Laurent Vivier , Kevin Wolf Paul Brook wrote: >> When sector-aligned guest offsets are converted to sector-unaligned >> writes (e.g. due to qcow2 etc.), that property is no longer satisfied, >> and power failure of the host disk can cause more damage than the >> guest is designed to be resistant to. >> > > Seems like the easiest solution would be to have qcow always align its writes. > We don't do on the fly compression, so it should be fairly easy to make this > happen with minimal overhead. > That's not sufficient. O_DIRECT imposes not only offset alignment requirements but also requirements on the buffer being read to. Most of the code in QEMU does not properly align the read/write buffers. Regards, Anthony Liguori > Paul > > >