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

* Re: [Qemu-devel] [Qemu-block] [PATCH] mirror: Skip block_job_defer_to_main_loop if already in the main context
  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 ` Stefan Hajnoczi
  2015-06-01  1:46   ` Fam Zheng
  2015-06-08  3:08 ` [Qemu-devel] " Fam Zheng
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2015-05-29 12:37 UTC (permalink / raw)
  To: Fam Zheng; +Cc: pbonzini, Jeff Cody, qemu-block, qemu-devel, stefanha

[-- Attachment #1: Type: text/plain, Size: 772 bytes --]

On Fri, May 29, 2015 at 10:22:13AM +0800, Fam Zheng wrote:
> 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(-)

Please CC Jeff Cody <jcody@redhat.com> on blockjob patches.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [Qemu-devel] [Qemu-block] [PATCH] mirror: Skip block_job_defer_to_main_loop if already in the main context
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Fam Zheng @ 2015-06-01  1:46 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: pbonzini, Jeff Cody, qemu-block, qemu-devel, stefanha

On Fri, 05/29 13:37, Stefan Hajnoczi wrote:
> On Fri, May 29, 2015 at 10:22:13AM +0800, Fam Zheng wrote:
> > 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(-)
> 
> Please CC Jeff Cody <jcody@redhat.com> on blockjob patches.

Didn't I?

Fam

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

* Re: [Qemu-devel] [Qemu-block] [PATCH] mirror: Skip block_job_defer_to_main_loop if already in the main context
  2015-06-01  1:46   ` Fam Zheng
@ 2015-06-01 12:55     ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2015-06-01 12:55 UTC (permalink / raw)
  To: Fam Zheng; +Cc: Stefan Hajnoczi, Jeff Cody, qemu-devel, qemu-block, pbonzini

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

On Mon, Jun 01, 2015 at 09:46:39AM +0800, Fam Zheng wrote:
> On Fri, 05/29 13:37, Stefan Hajnoczi wrote:
> > On Fri, May 29, 2015 at 10:22:13AM +0800, Fam Zheng wrote:
> > > 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(-)
> > 
> > Please CC Jeff Cody <jcody@redhat.com> on blockjob patches.
> 
> Didn't I?

Oops, sorry I missed it.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [Qemu-devel] [PATCH] mirror: Skip block_job_defer_to_main_loop if already in the main context
  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-08  3:08 ` Fam Zheng
  1 sibling, 0 replies; 5+ messages in thread
From: Fam Zheng @ 2015-06-08  3:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, pbonzini, Jeff Cody, qemu-block, stefanha

On Fri, 05/29 10:22, Fam Zheng wrote:
> 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.

This one is superceded by

[PATCH v2 07/13] mirror: Protect source between bdrv_drain and bdrv_swap

Fam

> 
> 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	[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).