From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xhr-0001Fc-Jt for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0xhl-0003hn-5L for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:36:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xhk-0003hZ-UT for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:36:53 -0400 From: Kevin Wolf Date: Tue, 6 Sep 2011 17:39:16 +0200 Message-Id: <1315323586-23840-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1315323586-23840-1-git-send-email-kwolf@redhat.com> References: <1315323586-23840-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 01/31] linux aio: some comments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Frediano Ziglio Add some notes about Linux AIO explaining why we don't use AIO in some situations. Signed-off-by: Frediano Ziglio Signed-off-by: Kevin Wolf --- block/raw-posix.c | 4 ++++ linux-aio.c | 1 + 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index c5c9944..bcf50b2 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -236,6 +236,10 @@ static int raw_open_common(BlockDriverState *bs, const char *filename, } #ifdef CONFIG_LINUX_AIO + /* + * Currently Linux do AIO only for files opened with O_DIRECT + * specified so check NOCACHE flag too + */ if ((bdrv_flags & (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) == (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) { diff --git a/linux-aio.c b/linux-aio.c index 5fd3932..5265a02 100644 --- a/linux-aio.c +++ b/linux-aio.c @@ -181,6 +181,7 @@ BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd, case QEMU_AIO_READ: io_prep_preadv(iocbs, fd, qiov->iov, qiov->niov, offset); break; + /* Currently Linux kernel does not support other operations */ default: fprintf(stderr, "%s: invalid AIO request type 0x%x.\n", __func__, type); -- 1.7.6