]> git.proxmox.com Git - mirror_qemu.git/commitdiff
aio: Introduce aio_external_disabled
authorFam Zheng <famz@redhat.com>
Fri, 30 Oct 2015 04:06:27 +0000 (12:06 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 9 Nov 2015 09:59:32 +0000 (09:59 +0000)
This allows AioContext users to check the enable/disable state of
external clients.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1446177989-6702-2-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
include/block/aio.h

index 92efc5e1f1c5b803fbcba5bda7638b645f67ecaf..cab7c765e3db97465fe68e3ac5ee680a9e5f95bc 100644 (file)
@@ -405,6 +405,17 @@ static inline void aio_enable_external(AioContext *ctx)
     atomic_dec(&ctx->external_disable_cnt);
 }
 
+/**
+ * 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