From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Qemu-devel] [PATCH][RFC] Linux AIO support when using O_DIRECT Date: Mon, 23 Mar 2009 21:35:37 +0200 Message-ID: <49C7E489.4070604@redhat.com> References: <1237823124-6417-1-git-send-email-aliguori@us.ibm.com> <49C7B620.8030203@redhat.com> <49C7C392.3030001@codemonkey.ws> <20090323172928.GB29449@infradead.org> <49C7D096.3000302@codemonkey.ws> <20090323184827.GA14826@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, Christoph Hellwig , kvm@vger.kernel.org To: Christoph Hellwig Return-path: Received: from mx2.redhat.com ([66.187.237.31]:36360 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183AbZCWTfS (ORCPT ); Mon, 23 Mar 2009 15:35:18 -0400 In-Reply-To: <20090323184827.GA14826@lst.de> Sender: kvm-owner@vger.kernel.org List-ID: Christoph Hellwig wrote: > On Mon, Mar 23, 2009 at 01:10:30PM -0500, Anthony Liguori wrote: > >> I really dislike having so many APIs. I'd rather have an aio API that >> took byte accesses or have pread/pwrite always be emulated with a full >> sector read/write >> > > I had patches to change the aio API to byte based access, and get rid > of the read/write methods to only have the byte based pread/pwrite > APIs, but thay got obsoleted by Avi's patch to kill the pread/pwrite > ops. We could put in byte-based AIO without byte-based read/write, > though. In my patches I put a flag into BlockDriverState whether we > allow byte-based access to this instance or otherwise emulated it in > the block layer. I like this approach. An additional flag could tell us what buffer alignment the format driver wants, so we can eliminate the alignment bounce from format driver code. Oh, and a flag to indicate we don't support vectors, so the generic layer will bounce and send us a length one iovec. Note the align flag is in the device state, not the format driver, as it depends on the cache= settings. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.