qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] mirror: Skip block_job_defer_to_main_loop if already in the main context
@ 2015-05-29  2:22 Fam Zheng
  2015-05-29 12:37 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
  2015-06-08  3:08 ` [Qemu-devel] " Fam Zheng
  0 siblings, 2 replies; 5+ messages in thread
From: Fam Zheng @ 2015-05-29  2:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, pbonzini, Jeff Cody, stefanha, qemu-block

mirror_exit does the replacing, which requires source and target to be
in sync, unfortunately we can't guarantee that before we have a complete
block pause mechanism. So for non-dataplane block jobs, let's do the old
thing as pre commit 5a7e7a0ba (block: let mirror blockjob run in BDS
AioContext) - directly call mirror_exit().

Dataplane case is taken care of in separate patches.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/mirror.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/block/mirror.c b/block/mirror.c
index 58f391a..112393a 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -565,7 +565,11 @@ immediate_exit:
 
     data = g_malloc(sizeof(*data));
     data->ret = ret;
-    block_job_defer_to_main_loop(&s->common, mirror_exit, data);
+    if (bs->aio_context == qemu_get_aio_context()) {
+        mirror_exit(&s->common, data);
+    } else {
+        block_job_defer_to_main_loop(&s->common, mirror_exit, data);
+    }
 }
 
 static void mirror_set_speed(BlockJob *job, int64_t speed, Error **errp)
-- 
2.4.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-08  3:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29  2:22 [Qemu-devel] [PATCH] mirror: Skip block_job_defer_to_main_loop if already in the main context Fam Zheng
2015-05-29 12:37 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-06-01  1:46   ` Fam Zheng
2015-06-01 12:55     ` Stefan Hajnoczi
2015-06-08  3:08 ` [Qemu-devel] " Fam Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).