From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZulBn-0007wp-U3 for qemu-devel@nongnu.org; Fri, 06 Nov 2015 12:52:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZulBm-00018j-W3 for qemu-devel@nongnu.org; Fri, 06 Nov 2015 12:52:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZulBm-00018M-Qq for qemu-devel@nongnu.org; Fri, 06 Nov 2015 12:52:38 -0500 From: Stefan Hajnoczi Date: Fri, 6 Nov 2015 17:52:25 +0000 Message-Id: <1446832349-14952-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1446832349-14952-1-git-send-email-stefanha@redhat.com> References: <1446832349-14952-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 3/7] aio: Introduce aio_external_disabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Fam Zheng , Stefan Hajnoczi 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. -- 2.5.0