From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lru5W-0007K2-FB for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:14:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lru5R-0007IA-SH for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:14:38 -0400 Received: from [199.232.76.173] (port=37592 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lru5R-0007I3-H5 for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:14:33 -0400 Received: from yw-out-1718.google.com ([74.125.46.158]:10377) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lru5R-000503-B5 for qemu-devel@nongnu.org; Thu, 09 Apr 2009 09:14:33 -0400 Received: by yw-out-1718.google.com with SMTP id 9so362481ywk.82 for ; Thu, 09 Apr 2009 06:14:32 -0700 (PDT) Message-ID: <49DDF4B4.1050609@codemonkey.ws> Date: Thu, 09 Apr 2009 08:14:28 -0500 From: Anthony Liguori 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> In-Reply-To: <49DDC8E0.50900@eu.citrix.com> Content-Type: text/plain; charset=UTF-8; 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 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. Regards, Anthony Liguori