[PATCH 2/2] ui/vdagent: Unregister input handler of mouse during finalization

tugy@chinatelecom.cn posted 2 patches 2 years, 5 months ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>
There is a newer version of this series
[PATCH 2/2] ui/vdagent: Unregister input handler of mouse during finalization
Posted by tugy@chinatelecom.cn 2 years, 5 months ago
From: Guoyi Tu <tugy@chinatelecom.cn>

Input handler resource should be released when
VDAgentChardev object finalize

Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
Signed-off-by: dengpengcheng <dengpc12@chinatelecom.cn>
---
 ui/vdagent.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ui/vdagent.c b/ui/vdagent.c
index 386dc5abe0..4c9b3b7ba8 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -924,6 +924,9 @@ static void vdagent_chr_fini(Object *obj)
 {
     VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
 
+    if (vd->mouse_hs) {
+        qemu_input_handler_unregister(vd->mouse_hs);
+    }
     migrate_del_blocker(vd->migration_blocker);
     buffer_free(&vd->outbuf);
     error_free(vd->migration_blocker);
-- 
2.27.0
Re: [PATCH 2/2] ui/vdagent: Unregister input handler of mouse during finalization
Posted by Marc-André Lureau 2 years, 5 months ago
On Thu, Aug 17, 2023 at 3:33 PM <tugy@chinatelecom.cn> wrote:
>
> From: Guoyi Tu <tugy@chinatelecom.cn>
>
> Input handler resource should be released when
> VDAgentChardev object finalize
>
> Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
> Signed-off-by: dengpengcheng <dengpc12@chinatelecom.cn>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  ui/vdagent.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/ui/vdagent.c b/ui/vdagent.c
> index 386dc5abe0..4c9b3b7ba8 100644
> --- a/ui/vdagent.c
> +++ b/ui/vdagent.c
> @@ -924,6 +924,9 @@ static void vdagent_chr_fini(Object *obj)
>  {
>      VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
>
> +    if (vd->mouse_hs) {
> +        qemu_input_handler_unregister(vd->mouse_hs);
> +    }
>      migrate_del_blocker(vd->migration_blocker);
>      buffer_free(&vd->outbuf);
>      error_free(vd->migration_blocker);
> --
> 2.27.0
>
>


-- 
Marc-André Lureau