[Qemu-devel] [PATCH] virtio: Unregister memory listener when unrealize

Fam Zheng posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170510092333.8890-1-famz@redhat.com
Test checkpatch passed
Test docker passed
Test s390x passed
hw/virtio/virtio.c | 1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [PATCH] virtio: Unregister memory listener when unrealize
Posted by Fam Zheng 6 years, 10 months ago
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


Re: [Qemu-devel] [Qemu-stable] [PATCH] virtio: Unregister memory listener when unrealize
Posted by Fam Zheng 6 years, 10 months ago
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