Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0B6n-0006v4-Sr for qemu-devel@nongnu.org; Tue, 20 Oct 2009 05:34:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0B6j-0006uc-2n for qemu-devel@nongnu.org; Tue, 20 Oct 2009 05:34:25 -0400 Received: from [199.232.76.173] (port=60947 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0B6i-0006uR-Pb for qemu-devel@nongnu.org; Tue, 20 Oct 2009 05:34:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20833) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0B6i-0008S6-AU for qemu-devel@nongnu.org; Tue, 20 Oct 2009 05:34:20 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9K9YJ0W012053 for ; Tue, 20 Oct 2009 05:34:19 -0400 From: Kevin Wolf Date: Tue, 20 Oct 2009 11:33:12 +0200 Message-Id: <1256031192-8292-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] raw/linux-aio: Also initialize POSIX AIO List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf When using Linux AIO raw still falls back to POSIX AIO sometimes, so we should initialize it. Not initializing it happens to work if POSIX AIO is used by another drive, or if the format is not specified (probing the format uses POSIX AIO) or by pure luck (e.g. it doesn't seem to happen any more with qcow2 since we have re-added synchronous qcow2 functions). Signed-off-by: Kevin Wolf --- block/raw-posix.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 20b37a7..5547fb5 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -173,6 +173,10 @@ static int raw_open_common(BlockDriverState *bs, const char *filename, #ifdef CONFIG_LINUX_AIO if ((bdrv_flags & (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) == (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) { + + /* We're falling back to POSIX AIO in some cases */ + paio_init(); + s->aio_ctx = laio_init(); if (!s->aio_ctx) { goto out_free_buf; -- 1.6.2.5