From patchwork Mon Nov 9 10:08:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 541678 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 0ACFB1402D4 for ; Mon, 9 Nov 2015 21:11:20 +1100 (AEDT) Received: from localhost ([::1]:51352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvjPy-0005lR-55 for incoming@patchwork.ozlabs.org; Mon, 09 Nov 2015 05:11:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvjNK-0001Oy-3s for qemu-devel@nongnu.org; Mon, 09 Nov 2015 05:08:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvjNJ-0006NR-AE for qemu-devel@nongnu.org; Mon, 09 Nov 2015 05:08:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvjNJ-0006NM-5Q for qemu-devel@nongnu.org; Mon, 09 Nov 2015 05:08:33 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id BFD248E22D; Mon, 9 Nov 2015 10:08:32 +0000 (UTC) Received: from localhost (ovpn-112-66.ams2.redhat.com [10.36.112.66]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA9A8VBr009719; Mon, 9 Nov 2015 05:08:32 -0500 From: Stefan Hajnoczi To: Date: Mon, 9 Nov 2015 10:08:20 +0000 Message-Id: <1447063704-24893-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1447063704-24893-1-git-send-email-stefanha@redhat.com> References: <1447063704-24893-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Fam Zheng , Stefan Hajnoczi Subject: [Qemu-devel] [PULL v2 3/7] aio: Introduce aio_external_disabled 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 From: Fam Zheng This allows AioContext users to check the enable/disable state of external clients. Signed-off-by: Fam Zheng Message-id: 1446177989-6702-2-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi --- include/block/aio.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/block/aio.h b/include/block/aio.h index 92efc5e..cab7c76 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -406,6 +406,17 @@ static inline void aio_enable_external(AioContext *ctx) } /** + * aio_external_disabled: + * @ctx: the aio context + * + * Return true if the external clients are disabled. + */ +static inline bool aio_external_disabled(AioContext *ctx) +{ + return atomic_read(&ctx->external_disable_cnt); +} + +/** * aio_node_check: * @ctx: the aio context * @is_external: Whether or not the checked node is an external event source.