]> Git Repo - qemu.git/commitdiff
aio: rename aio_context_in_iothread() to in_aio_context_home_thread()
authorStefan Hajnoczi <[email protected]>
Fri, 16 Feb 2018 16:50:11 +0000 (16:50 +0000)
committerKevin Wolf <[email protected]>
Fri, 2 Mar 2018 17:39:07 +0000 (18:39 +0100)
The name aio_context_in_iothread() is misleading because it also returns
true when called on the main AioContext from the main loop thread, which
is not an IOThread.

This patch renames it to in_aio_context_home_thread() and expands the
doc comment to make the semantics clearer.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
include/block/aio.h
include/block/block.h

index e9aeeaec94484afe26f5b9d35c014ff7d117e710..a1d6b9e249394ddd43d9ba99026e3f48f31dffc2 100644 (file)
@@ -534,11 +534,14 @@ void aio_co_enter(AioContext *ctx, struct Coroutine *co);
 AioContext *qemu_get_current_aio_context(void);
 
 /**
+ * in_aio_context_home_thread:
  * @ctx: the aio context
  *
- * Return whether we are running in the I/O thread that manages @ctx.
+ * Return whether we are running in the thread that normally runs @ctx.  Note
+ * that acquiring/releasing ctx does not affect the outcome, each AioContext
+ * still only has one home thread that is responsible for running it.
  */
-static inline bool aio_context_in_iothread(AioContext *ctx)
+static inline bool in_aio_context_home_thread(AioContext *ctx)
 {
     return ctx == qemu_get_current_aio_context();
 }
index 947e8876cdd71ed44ecd8ec737e9e09ede17bd04..bc41ed253b5d0576dcd6c137c41eb3aa591aa5fc 100644 (file)
@@ -372,7 +372,7 @@ void bdrv_drain_all(void);
     bool busy_ = true;                                     \
     BlockDriverState *bs_ = (bs);                          \
     AioContext *ctx_ = bdrv_get_aio_context(bs_);          \
-    if (aio_context_in_iothread(ctx_)) {                   \
+    if (in_aio_context_home_thread(ctx_)) {                \
         while ((cond) || busy_) {                          \
             busy_ = aio_poll(ctx_, (cond));                \
             waited_ |= !!(cond) | busy_;                   \
This page took 0.02953 seconds and 4 git commands to generate.