From patchwork Tue Aug 30 07:46:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 112187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1C670B6F8F for ; Tue, 30 Aug 2011 17:46:12 +1000 (EST) Received: from localhost ([::1]:34749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyJ1D-0006lw-1r for incoming@patchwork.ozlabs.org; Tue, 30 Aug 2011 03:45:59 -0400 Received: from eggs.gnu.org ([140.186.70.92]:40237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyJ17-0006lf-7m for qemu-devel@nongnu.org; Tue, 30 Aug 2011 03:45:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyJ15-0003B5-PZ for qemu-devel@nongnu.org; Tue, 30 Aug 2011 03:45:53 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:59283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyJ15-0003At-HR for qemu-devel@nongnu.org; Tue, 30 Aug 2011 03:45:51 -0400 Received: by qyk31 with SMTP id 31so2497511qyk.4 for ; Tue, 30 Aug 2011 00:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=MCwIBL3z/7TI1eL7MX05UcOm9lzuzOIS0lT7iHQR3kE=; b=Yf1acBpHkxaCgzBcKOoh/wiHVMUTYy2d/Wlz3eDtwqIfzwGA6ghWF2AwhhEXBc5WjN Do3eHo6MJysE/+O8IXFLsP8MoTzM/UcyCH4woUZxn9KEM8RbjQsO/G5dglKbu0OXmgVm 7n1/rxIHcexUTcbqiWjudDIm0xP7mMemzI1oo= Received: by 10.224.216.72 with SMTP id hh8mr1396988qab.138.1314690350703; Tue, 30 Aug 2011 00:45:50 -0700 (PDT) Received: from obol602.omnitel.it (tor-proxy.anfani.com. [97.107.142.93]) by mx.google.com with ESMTPS id fq5sm9472915qab.15.2011.08.30.00.45.48 (version=SSLv3 cipher=OTHER); Tue, 30 Aug 2011 00:45:50 -0700 (PDT) From: Frediano Ziglio To: kwolf@redhat.com Date: Tue, 30 Aug 2011 09:46:11 +0200 Message-Id: <1314690371-9138-1-git-send-email-freddy77@gmail.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.173 Cc: qemu-devel@nongnu.org, Frediano Ziglio Subject: [Qemu-devel] [PATCH] linux aio: some comments X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add some notes about Linux AIO explaining why we don't use AIO in some situations. Signed-off-by: Frediano Ziglio --- 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);