This call is introduced simply as a wrapper of aio_poll, but it makes it
is easy to change the polled client types.

Signed-off-by: Fam Zheng <f...@redhat.com>
---
 block/io.c            | 8 ++++++++
 include/block/aio.h   | 2 +-
 include/block/block.h | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/block/io.c b/block/io.c
index d4bc83b..aca5dff 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2608,3 +2608,11 @@ void bdrv_flush_io_queue(BlockDriverState *bs)
     }
     bdrv_start_throttled_reqs(bs);
 }
+
+bool bdrv_aio_poll(AioContext *ctx, bool blocking)
+{
+    bool ret;
+
+    ret = aio_poll(ctx, blocking);
+    return ret;
+}
diff --git a/include/block/aio.h b/include/block/aio.h
index fb70cc5..53fc400 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -385,7 +385,7 @@ void aio_disable_enable_clients(AioContext *ctx, int 
clients_mask,
  * aio_disable_clients:
  * @ctx: the aio context
  *
- * Disable the furthur processing by aio_poll(ctx) of clients.
+ * Disable the processing of clients by further aio_poll(ctx).
  */
 static inline void aio_disable_clients(AioContext *ctx, int clients_mask)
 {
diff --git a/include/block/block.h b/include/block/block.h
index 37916f7..be99e6d 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -616,4 +616,6 @@ void bdrv_flush_io_queue(BlockDriverState *bs);
 
 BlockAcctStats *bdrv_get_stats(BlockDriverState *bs);
 
+bool bdrv_aio_poll(AioContext *ctx, bool blocking);
+
 #endif
-- 
2.4.3


Reply via email to