From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LruKq-0007ua-1A for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:30:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LruKl-0007ss-Go for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:30:27 -0400 Received: from [199.232.76.173] (port=58866 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LruKl-0007sl-A5 for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:30:23 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:20362) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LruKk-0007XU-JD for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:30:22 -0400 Received: from [10.80.225.184] ([10.80.225.184]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id n39DUK8d002042 for ; Thu, 9 Apr 2009 06:30:21 -0700 Message-ID: <49DDF87D.4070701@eu.citrix.com> Date: Thu, 09 Apr 2009 14:30:37 +0100 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] buffer alignment for block backends References: <49DCA80A.1020808@eu.citrix.com> <49DCF2C0.9070704@codemonkey.ws> <49DDC8E0.50900@eu.citrix.com> <49DDF4B4.1050609@codemonkey.ws> In-Reply-To: <49DDF4B4.1050609@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 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" Anthony Liguori wrote: > Stefano Stabellini wrote: >> Anthony Liguori wrote: >> >> >>>> If you do not want to do that, another possible solution is to create a >>>> new function called "qemu_blockalign" that would be implemented as >>>> qemu_memalign(512, size); >>>> >>> This is fine, but this is purely an optimization, it cannot be relied >>> upon in the general case. >>> >>> >> >> >> If you are OK with this, a simple patch like the following is >> acceptable, or do you prefer a more formal approach involving a new >> function in the BlockDriver interface? >> > > Yes, but that's not covering very many of the cases. There are still > places where we allocate bounce buffers that aren't with memalign (like > in block-qcow2.c). Also, please document what the new function does and > when it should be used. > Ok, I'll try to find all those places.