qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: Inactivate all nodes at migration source
@ 2016-04-15  3:11 Fam Zheng
  2016-04-15 15:11 ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Fam Zheng @ 2016-04-15  3:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Max Reitz, qemu-block

qcow2 is not necessarily the top layer node. Since bdrv_inactivate()
doesn't recurse, we should ensure all block nodes are inactivated.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index d4939b4..1c575e4 100644
--- a/block.c
+++ b/block.c
@@ -3270,7 +3270,7 @@ int bdrv_inactivate_all(void)
     BlockDriverState *bs = NULL;
     int ret;
 
-    while ((bs = bdrv_next(bs)) != NULL) {
+    while ((bs = bdrv_next_node(bs)) != NULL) {
         AioContext *aio_context = bdrv_get_aio_context(bs);
 
         aio_context_acquire(aio_context);
-- 
2.8.0

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

* Re: [Qemu-devel] [PATCH] block: Inactivate all nodes at migration source
  2016-04-15  3:11 [Qemu-devel] [PATCH] block: Inactivate all nodes at migration source Fam Zheng
@ 2016-04-15 15:11 ` Kevin Wolf
  2016-04-18  1:36   ` Fam Zheng
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Wolf @ 2016-04-15 15:11 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, Max Reitz, qemu-block

Am 15.04.2016 um 05:11 hat Fam Zheng geschrieben:
> qcow2 is not necessarily the top layer node. Since bdrv_inactivate()
> doesn't recurse, we should ensure all block nodes are inactivated.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>

Hm, I don't think that's quite right. bdrv_inactivate_all() should be
the opposite of bdrv_invalidate_cache_all(), i.e. both operations should
affect the same nodes.

Currently, both use bdrv_next(), but bdrv_invalidate_cache() is
partially recursive: It is called for bs->file (by block.c if there is
no implementation for bs, by the driver implementation otherwise), or
for all children in the quorum case, but not for other children like
bs->backing or the extents for VMDK.

If you think that that sounds wrong, I'm with you. :-) The question is
how to fix it. I think I'd make bdrv_invalidate() recurse to all
children and then do the same for bdrv_inactivate().

Kevin

>  block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index d4939b4..1c575e4 100644
> --- a/block.c
> +++ b/block.c
> @@ -3270,7 +3270,7 @@ int bdrv_inactivate_all(void)
>      BlockDriverState *bs = NULL;
>      int ret;
>  
> -    while ((bs = bdrv_next(bs)) != NULL) {
> +    while ((bs = bdrv_next_node(bs)) != NULL) {
>          AioContext *aio_context = bdrv_get_aio_context(bs);
>  
>          aio_context_acquire(aio_context);
> -- 
> 2.8.0
> 

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

* Re: [Qemu-devel] [PATCH] block: Inactivate all nodes at migration source
  2016-04-15 15:11 ` Kevin Wolf
@ 2016-04-18  1:36   ` Fam Zheng
  0 siblings, 0 replies; 3+ messages in thread
From: Fam Zheng @ 2016-04-18  1:36 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, Max Reitz, qemu-block

On Fri, 04/15 17:11, Kevin Wolf wrote:
> Am 15.04.2016 um 05:11 hat Fam Zheng geschrieben:
> > qcow2 is not necessarily the top layer node. Since bdrv_inactivate()
> > doesn't recurse, we should ensure all block nodes are inactivated.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> 
> Hm, I don't think that's quite right. bdrv_inactivate_all() should be
> the opposite of bdrv_invalidate_cache_all(), i.e. both operations should
> affect the same nodes.
> 
> Currently, both use bdrv_next(), but bdrv_invalidate_cache() is
> partially recursive: It is called for bs->file (by block.c if there is
> no implementation for bs, by the driver implementation otherwise), or
> for all children in the quorum case, but not for other children like
> bs->backing or the extents for VMDK.
> 
> If you think that that sounds wrong, I'm with you. :-) The question is
> how to fix it. I think I'd make bdrv_invalidate() recurse to all
> children and then do the same for bdrv_inactivate().

That makes sense, I'll try again.

Fam

> 
> Kevin
> 
> >  block.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/block.c b/block.c
> > index d4939b4..1c575e4 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -3270,7 +3270,7 @@ int bdrv_inactivate_all(void)
> >      BlockDriverState *bs = NULL;
> >      int ret;
> >  
> > -    while ((bs = bdrv_next(bs)) != NULL) {
> > +    while ((bs = bdrv_next_node(bs)) != NULL) {
> >          AioContext *aio_context = bdrv_get_aio_context(bs);
> >  
> >          aio_context_acquire(aio_context);
> > -- 
> > 2.8.0
> > 

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

end of thread, other threads:[~2016-04-18  1:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-15  3:11 [Qemu-devel] [PATCH] block: Inactivate all nodes at migration source Fam Zheng
2016-04-15 15:11 ` Kevin Wolf
2016-04-18  1:36   ` 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).