From patchwork Thu Mar 19 15:16:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 452008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EBC33140083 for ; Fri, 20 Mar 2015 02:17:13 +1100 (AEDT) Received: from localhost ([::1]:39714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYcC7-00024M-6i for incoming@patchwork.ozlabs.org; Thu, 19 Mar 2015 11:17:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYcBa-00016I-NP for qemu-devel@nongnu.org; Thu, 19 Mar 2015 11:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYcBZ-00088V-OM for qemu-devel@nongnu.org; Thu, 19 Mar 2015 11:16:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYcBS-00085p-IL; Thu, 19 Mar 2015 11:16:30 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 4464EB5BFD; Thu, 19 Mar 2015 15:16:30 +0000 (UTC) Received: from noname.redhat.com (ovpn-116-54.ams2.redhat.com [10.36.116.54]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2JFGPnU020966; Thu, 19 Mar 2015 11:16:29 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 19 Mar 2015 16:16:13 +0100 Message-Id: <1426778174-1170-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1426778174-1170-1-git-send-email-kwolf@redhat.com> References: <1426778174-1170-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 2/3] raw-posix: Deprecate aio=threads fallback without O_DIRECT 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 Currently, if the user requests aio=native, but forgets to choose a cache mode that sets O_DIRECT, that request is silently ignored and raw falls back to aio=threads. Deprecate that behaviour so we can make it an error in future qemu versions. Signed-off-by: Kevin Wolf Reviewed-by: Markus Armbruster --- block/raw-posix.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 844ac21..24d8582 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -503,6 +503,14 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, error_setg_errno(errp, -ret, "Could not set AIO state"); goto fail; } + if (!s->use_aio && (bdrv_flags & BDRV_O_NATIVE_AIO)) { + error_printf("WARNING: aio=native was specified for '%s', but " + "it requires cache.direct=on, which was not " + "specified. Falling back to aio=threads.\n" + " This will become an error condition in " + "future QEMU versions.\n", + bs->filename); + } #endif s->has_discard = true;