summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorFam Zheng2015-10-30 05:06:27 +0100
committerStefan Hajnoczi2015-11-09 10:59:32 +0100
commit5ceb9e39284b69d2e1b01da3cb1894ad4b2b4606 (patch)
tree2181dd7aec6b2379716bfd55c97a82512f449e75 /include/block
parentdataplane: support non-contigious s/g (diff)
downloadqemu-5ceb9e39284b69d2e1b01da3cb1894ad4b2b4606.tar.gz
qemu-5ceb9e39284b69d2e1b01da3cb1894ad4b2b4606.tar.xz
qemu-5ceb9e39284b69d2e1b01da3cb1894ad4b2b4606.zip
aio: Introduce aio_external_disabled
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>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/aio.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/block/aio.h b/include/block/aio.h
index 92efc5e1f1..cab7c765e3 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.