summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-12-02 16:24:26 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-12-02 16:24:26 +0000
commit2196b6f5dd5a07ed95d51f0d5f2f3fb20a076b13 (patch)
treec9ea191fcc18adad73e32f07cf6a2f3ef3023b5b
parent30a9fd5d13b0a4290382adc4c1bf619677066b89 (diff)
parent176c36997fd4a94a7b919468d8967e0ad81fdf9c (diff)
downloadhqemu-2196b6f5dd5a07ed95d51f0d5f2f3fb20a076b13.zip
hqemu-2196b6f5dd5a07ed95d51f0d5f2f3fb20a076b13.tar.gz
Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging
# gpg: Signature made Wed 02 Dec 2015 15:45:36 GMT using RSA key ID C0DE3057 # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>" # gpg: aka "Jeffrey Cody <jeff@codyprime.org>" # gpg: aka "Jeffrey Cody <codyprime@gmail.com>" * remotes/cody/tags/block-pull-request: mirror: Quiesce source during "mirror_exit" Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--block/mirror.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/mirror.c b/block/mirror.c
index 52c9abf..0e8f556 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -388,6 +388,7 @@ static void mirror_exit(BlockJob *job, void *opaque)
bdrv_unref(s->target);
block_job_completed(&s->common, data->ret);
g_free(data);
+ bdrv_drained_end(src);
bdrv_unref(src);
}
@@ -607,6 +608,9 @@ immediate_exit:
data = g_malloc(sizeof(*data));
data->ret = ret;
+ /* Before we switch to target in mirror_exit, make sure data doesn't
+ * change. */
+ bdrv_drained_begin(s->common.bs);
block_job_defer_to_main_loop(&s->common, mirror_exit, data);
}
OpenPOWER on IntegriCloud