summaryrefslogtreecommitdiffstats
path: root/util/async.c
diff options
context:
space:
mode:
authorPeter Maydell2017-04-11 14:27:05 +0200
committerPeter Maydell2017-04-11 14:27:05 +0200
commitaa388ddc36e8032f41cd17bef88cc3ebaeba77c9 (patch)
treeec6ce58ff71332901a8ab5957c5221c66440a9ac /util/async.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/pull-fixes-20170411-1' into... (diff)
parentsheepdog: Use bdrv_coroutine_enter before BDRV_POLL_WHILE (diff)
downloadqemu-aa388ddc36e8032f41cd17bef88cc3ebaeba77c9.tar.gz
qemu-aa388ddc36e8032f41cd17bef88cc3ebaeba77c9.tar.xz
qemu-aa388ddc36e8032f41cd17bef88cc3ebaeba77c9.zip
Merge remote-tracking branch 'remotes/famz/tags/block-pull-request' into staging
# gpg: Signature made Tue 11 Apr 2017 13:10:55 BST # gpg: using RSA key 0xCA35624C6A9171C6 # gpg: Good signature from "Fam Zheng <famz@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 5003 7CB7 9706 0F76 F021 AD56 CA35 624C 6A91 71C6 * remotes/famz/tags/block-pull-request: sheepdog: Use bdrv_coroutine_enter before BDRV_POLL_WHILE block: Fix bdrv_co_flush early return block: Use bdrv_coroutine_enter to start I/O coroutines qemu-io-cmds: Use bdrv_coroutine_enter blockjob: Use bdrv_coroutine_enter to start coroutine block: Introduce bdrv_coroutine_enter async: Introduce aio_co_enter coroutine: Extract qemu_aio_coroutine_enter tests/block-job-txn: Don't start block job before adding to txn block: Quiesce old aio context during bdrv_set_aio_context block: Make bdrv_parent_drained_begin/end public Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/async.c')
-rw-r--r--util/async.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/async.c b/util/async.c
index 663e297e1f..355af73ee7 100644
--- a/util/async.c
+++ b/util/async.c
@@ -453,6 +453,11 @@ void aio_co_wake(struct Coroutine *co)
smp_read_barrier_depends();
ctx = atomic_read(&co->ctx);
+ aio_co_enter(ctx, co);
+}
+
+void aio_co_enter(AioContext *ctx, struct Coroutine *co)
+{
if (ctx != qemu_get_current_aio_context()) {
aio_co_schedule(ctx, co);
return;
@@ -464,7 +469,7 @@ void aio_co_wake(struct Coroutine *co)
QSIMPLEQ_INSERT_TAIL(&self->co_queue_wakeup, co, co_queue_next);
} else {
aio_context_acquire(ctx);
- qemu_coroutine_enter(co);
+ qemu_aio_coroutine_enter(ctx, co);
aio_context_release(ctx);
}
}