From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JyXnt-0007EY-VH for qemu-devel@nongnu.org; Tue, 20 May 2008 15:47:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JyXns-0007DF-9A for qemu-devel@nongnu.org; Tue, 20 May 2008 15:47:21 -0400 Received: from [199.232.76.173] (port=55119 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JyXns-0007D0-24 for qemu-devel@nongnu.org; Tue, 20 May 2008 15:47:20 -0400 Received: from wr-out-0506.google.com ([64.233.184.236]:53929) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JyXnr-0001LU-Oh for qemu-devel@nongnu.org; Tue, 20 May 2008 15:47:19 -0400 Received: by wr-out-0506.google.com with SMTP id c49so1144679wra.19 for ; Tue, 20 May 2008 12:47:17 -0700 (PDT) Message-ID: <48332AB9.3010707@codemonkey.ws> Date: Tue, 20 May 2008 14:47:05 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1211283126.4314.70.camel@frecb07144> In-Reply-To: <1211283126.4314.70.camel@frecb07144> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH][v2] Align file accesses with cache=off (O_DIRECT) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Blue Swirl , "qemu-devel@nongnu.org" , Kevin Wolf Laurent Vivier wrote: > This patch is the original patch from Kevin Wolf modified according > comments given on the qemu-devel Mailing list. > > Original Description: > > "In December a patch was applied which introduced the cache=off option > to -drive. When using this option files are opened with the O_DIRECT > flag. > This means that all accesses have to be aligned. The patch made a couple > of changes in this respect, still in other places they are missing (e.g. > you can't use cache=off with qcow(2) files). > > This patch implements wrappers for raw_pread and raw_pwrite which align > all file accesses and make qcow(2) work with cache=off. This method > might not be the most performant one (compared to fixing qcow, qcow2 and > everything else that might be using unaligned accesses), but unaligned > accesses don't happen that frequently and with this patch really all > image accesses should be covered." > > Modifications: > > - Kevin has modified his patch to call the read/write AIO callback > outside the aio_read/write > - I've modified the buffer management to allocate buffer on open and not > on each read/write. > > As mentioned by Kevin, this patch is really needed to be able to manage > all disk images with "cache=off" option, so pleeeaaaase, apply (or > comment...) > > A la GIT: > > Signed-off-by: Kevin Wolf > Signed-off-by: Laurent Vivier > Looks better to me. Acked-by: Anthony Liguori Regads, Anthony Liguori