[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 26/37] aio: rename aio_context_in_iothread() to in_ai
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 26/37] aio: rename aio_context_in_iothread() to in_aio_context_home_thread() |
Date: |
Fri, 2 Mar 2018 19:54:37 +0100 |
From: Stefan Hajnoczi <address@hidden>
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
include/block/aio.h | 7 +++++--
include/block/block.h | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/block/aio.h b/include/block/aio.h
index e9aeeaec94..a1d6b9e249 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -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();
}
diff --git a/include/block/block.h b/include/block/block.h
index 947e8876cd..bc41ed253b 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -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_; \
--
2.13.6
- [Qemu-devel] [PULL 14/37] raw: Switch to .bdrv_co_block_status(), (continued)
- [Qemu-devel] [PULL 14/37] raw: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 15/37] sheepdog: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 16/37] vdi: Avoid bitrot of debugging code, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 17/37] vdi: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 18/37] vmdk: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 19/37] vpc: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 20/37] vvfat: Switch to .bdrv_co_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 22/37] block: fix write with zero flag set and iovector provided, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 21/37] block: Drop unused .bdrv_co_get_block_status(), Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 23/37] iotest 033: add misaligned write-zeroes test via truncate, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 26/37] aio: rename aio_context_in_iothread() to in_aio_context_home_thread(),
Kevin Wolf <=
- [Qemu-devel] [PULL 25/37] docs: document how to use the l2-cache-entry-size parameter, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 24/37] specs/qcow2: Fix documentation of the compressed cluster descriptor, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 28/37] block: add BlockBackend->in_flight counter, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 27/37] block: extract AIO_WAIT_WHILE() from BlockDriverState, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 30/37] Revert "IDE: Do not flush empty CDROM drives", Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 29/37] block: test blk_aio_flush() with blk->root == NULL, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 32/37] qcow2: make qcow2_co_create2() a coroutine_fn, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 33/37] qemu-img: Make resize error message more general, Kevin Wolf, 2018/03/02
- [Qemu-devel] [PULL 31/37] block: rename .bdrv_create() to .bdrv_co_create_opts(), Kevin Wolf, 2018/03/02