From patchwork Tue Oct 20 09:33:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 36454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1A9C0B7B99 for ; Tue, 20 Oct 2009 20:35:13 +1100 (EST) Received: from localhost ([127.0.0.1]:58164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0B7V-0006vb-VV for incoming@patchwork.ozlabs.org; Tue, 20 Oct 2009 05:35:10 -0400 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 Received: from localhost.localdomain (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9K9YHsr027272; Tue, 20 Oct 2009 05:34:18 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Tue, 20 Oct 2009 11:33:12 +0200 Message-Id: <1256031192-8292-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Kevin Wolf Subject: [Qemu-devel] [PATCH] raw/linux-aio: Also initialize POSIX AIO X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;