summaryrefslogtreecommitdiff
path: root/block/mirror.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-04-22 16:17:12 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-04-22 16:17:12 +0100
commit53343338a6e7b83777b82803398572b40afc8c0f (patch)
treea6b16ffcb414941d0cd6c63d0c7c3050a3a73451 /block/mirror.c
parentee1e0f8e5d3682c561edcdceccff72b9d9b16d8b (diff)
parentab27c3b5e7408693dde0b565f050aa55c4a1bcef (diff)
downloadqemu-53343338a6e7b83777b82803398572b40afc8c0f.tar.gz
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Mirror block job fixes for 2.6.0-rc4 # gpg: Signature made Fri 22 Apr 2016 15:46:41 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: mirror: Workaround for unexpected iohandler events during completion aio-posix: Skip external nodes in aio_dispatch virtio: Mark host notifiers as external event-notifier: Add "is_external" parameter iohandler: Introduce iohandler_get_aio_context Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block/mirror.c')
-rw-r--r--block/mirror.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block/mirror.c b/block/mirror.c
index d56e30e472..039f48125e 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -495,6 +495,9 @@ out:
block_job_completed(&s->common, data->ret);
g_free(data);
bdrv_drained_end(src);
+ if (qemu_get_aio_context() == bdrv_get_aio_context(src)) {
+ aio_enable_external(iohandler_get_aio_context());
+ }
bdrv_unref(src);
}
@@ -716,6 +719,12 @@ immediate_exit:
/* Before we switch to target in mirror_exit, make sure data doesn't
* change. */
bdrv_drained_begin(s->common.bs);
+ if (qemu_get_aio_context() == bdrv_get_aio_context(bs)) {
+ /* FIXME: virtio host notifiers run on iohandler_ctx, therefore the
+ * above bdrv_drained_end isn't enough to quiesce it. This is ugly, we
+ * need a block layer API change to achieve this. */
+ aio_disable_external(iohandler_get_aio_context());
+ }
block_job_defer_to_main_loop(&s->common, mirror_exit, data);
}