qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio: Unregister memory listener when unrealize
@ 2017-05-10  9:23 Fam Zheng
  2017-05-10  9:36 ` [Qemu-devel] [Qemu-stable] " Fam Zheng
  2017-05-10  9:51 ` [Qemu-devel] " Markus Armbruster
  0 siblings, 2 replies; 4+ messages in thread
From: Fam Zheng @ 2017-05-10  9:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-stable, Michael S. Tsirkin, Jason Wang

Cc: qemu-stable@nongnu.org
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 hw/virtio/virtio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 03592c5..a7741f4 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2515,6 +2515,7 @@ static void virtio_device_unrealize(DeviceState *dev, Error **errp)
         }
     }
 
+    memory_listener_unregister(&vdev->listener);
     g_free(vdev->bus_name);
     vdev->bus_name = NULL;
 }
-- 
2.9.3

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

* Re: [Qemu-devel] [Qemu-stable] [PATCH] virtio: Unregister memory listener when unrealize
  2017-05-10  9:23 [Qemu-devel] [PATCH] virtio: Unregister memory listener when unrealize Fam Zheng
@ 2017-05-10  9:36 ` Fam Zheng
  2017-05-10  9:51 ` [Qemu-devel] " Markus Armbruster
  1 sibling, 0 replies; 4+ messages in thread
From: Fam Zheng @ 2017-05-10  9:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Jason Wang, qemu-stable, Michael S. Tsirkin

On Wed, 05/10 17:23, Fam Zheng wrote:
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  hw/virtio/virtio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 03592c5..a7741f4 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2515,6 +2515,7 @@ static void virtio_device_unrealize(DeviceState *dev, Error **errp)
>          }
>      }
>  
> +    memory_listener_unregister(&vdev->listener);
>      g_free(vdev->bus_name);
>      vdev->bus_name = NULL;
>  }
> -- 
> 2.9.3
> 
> 

Oops, I think the one in the .finalize() callback should be removed meanwhile.

Fam

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

* Re: [Qemu-devel] [PATCH] virtio: Unregister memory listener when unrealize
  2017-05-10  9:23 [Qemu-devel] [PATCH] virtio: Unregister memory listener when unrealize Fam Zheng
  2017-05-10  9:36 ` [Qemu-devel] [Qemu-stable] " Fam Zheng
@ 2017-05-10  9:51 ` Markus Armbruster
  2017-05-10  9:58   ` Fam Zheng
  1 sibling, 1 reply; 4+ messages in thread
From: Markus Armbruster @ 2017-05-10  9:51 UTC (permalink / raw)
  To: Fam Zheng
  Cc: qemu-devel, Paolo Bonzini, Jason Wang, qemu-stable,
	Michael S. Tsirkin

Fam Zheng <famz@redhat.com> writes:

> Cc: qemu-stable@nongnu.org
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  hw/virtio/virtio.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 03592c5..a7741f4 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2515,6 +2515,7 @@ static void virtio_device_unrealize(DeviceState *dev, Error **errp)
>          }
>      }
>  
> +    memory_listener_unregister(&vdev->listener);
>      g_free(vdev->bus_name);
>      vdev->bus_name = NULL;
>  }

Is this a bug fix?  If yes, what exactly's broken without it?

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

* Re: [Qemu-devel] [PATCH] virtio: Unregister memory listener when unrealize
  2017-05-10  9:51 ` [Qemu-devel] " Markus Armbruster
@ 2017-05-10  9:58   ` Fam Zheng
  0 siblings, 0 replies; 4+ messages in thread
From: Fam Zheng @ 2017-05-10  9:58 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Paolo Bonzini, Jason Wang, Michael S. Tsirkin, qemu-devel,
	qemu-stable

On Wed, 05/10 11:51, Markus Armbruster wrote:
> Fam Zheng <famz@redhat.com> writes:
> 
> > Cc: qemu-stable@nongnu.org
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  hw/virtio/virtio.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> > index 03592c5..a7741f4 100644
> > --- a/hw/virtio/virtio.c
> > +++ b/hw/virtio/virtio.c
> > @@ -2515,6 +2515,7 @@ static void virtio_device_unrealize(DeviceState *dev, Error **errp)
> >          }
> >      }
> >  
> > +    memory_listener_unregister(&vdev->listener);
> >      g_free(vdev->bus_name);
> >      vdev->bus_name = NULL;
> >  }
> 
> Is this a bug fix?  If yes, what exactly's broken without it?
> 

I thought it was obvious (missing unregister) but that was a mistake. There is
one in virtio_device_instance_finalize(), but the callback is just not called
due to something else with the QOM refcnt.

Will revise, and add commit message, of course.

Fam

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

end of thread, other threads:[~2017-05-10  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-10  9:23 [Qemu-devel] [PATCH] virtio: Unregister memory listener when unrealize Fam Zheng
2017-05-10  9:36 ` [Qemu-devel] [Qemu-stable] " Fam Zheng
2017-05-10  9:51 ` [Qemu-devel] " Markus Armbruster
2017-05-10  9:58   ` 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).