ui/vdagent: Fix two bugs about disconnect event handling
cover ui/vdagent: Fix two bugs about disconnect event handling
From: Guoyi Tu <[email protected]>
and resource leak
Guoyi Tu (2):
ui/vdagent: call vdagent_disconnect() when agent connection is lost ui/vdagent: Unregister input handler of mouse during finalization
ui/vdagent.c | 6 ++++++ 1 file changed, 6 insertions(+)
Signature · 1 line
2.27.0
PATCH 1/2 ui/vdagent: call vdagent_disconnect() when agent connection is lost
From: Guoyi Tu <[email protected]>
when the agent connection is lost, the input handler of the mouse doesn't deactivate, which results in unresponsive mouse events in VNC windows.
To fix this issue, call vdagent_disconnect() to reset the state each time the frontend disconncect
--- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+)
ui/vdagent.c +3 -0
@@ -870,8 +870,11 @@ static void vdagent_disconnect(VDAgentChardev *vd)static void vdagent_chr_set_fe_open (struct Chardev *chr,int fe_open) { +VDAgentChardev *vd =QEMU_VDAGENT_CHARDEV (chr); +if (!fe_open) {trace_vdagent_close (); +vdagent_disconnect (vd);/* To reset_serial, we CLOSED our side. Make sure the other end knows we * are ready again. */ qemu_chr_be_event (chr,CHR_EVENT_OPENED );
Signature · 1 line
2.27.0
Re: [PATCH v1 1/2] ui/vdagent: call vdagent_disconnect() when agent connection is lost
Quoted 7 lines · On Thu, Aug 17, 2023 at 6:24 PM <[email protected]> wrote:
From: Guoyi Tu <[email protected]>
when the agent connection is lost, the input handler of the mouse doesn't deactivate, which results in unresponsive mouse events in VNC windows.
Quoted 5 lines
To fix this issue, call
vdagent_disconnect()to reset the state each time the frontend disconncectSigned-off-by Guoyi Tu <[email protected]>Signed-off-by dengpengcheng <[email protected]>
Quoted 24 lines
--- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+)ui/vdagent.c +3
-1@@ -870,8 +870,11 @@ static void vdagent_disconnect(VDAgentChardev *vd)static void vdagent_chr_set_fe_open (struct Chardev *chr,int fe_open) { +VDAgentChardev *vd =QEMU_VDAGENT_CHARDEV (chr); +if (!fe_open) {trace_vdagent_close (); +vdagent_disconnect (vd);/* To reset_serial, we CLOSED our side. Make sure the other end knows we * are ready again. */ qemu_chr_be_event (chr,CHR_EVENT_OPENED ); --2.27.0
Signature · 1 line
Marc-André Lureau
PATCH 2/2 ui/vdagent: Unregister input handler of mouse during finalization
In reply to [email protected]From: Guoyi Tu <[email protected]>
Input handler resource should be released when
VDAgentChardev object finalize
--- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+)
ui/vdagent.c +3 -0
@@ -926,6 +926,9 @@ static void vdagent_chr_fini(Object *obj)migrate_del_blocker (vd->migration_blocker);vdagent_disconnect (vd); +if (vd->mouse_hs) { +qemu_input_handler_unregister (vd->mouse_hs); + }buffer_free (&vd->outbuf);error_free (vd->migration_blocker); }
Signature · 1 line
2.27.0
Re: [PATCH v1 2/2] ui/vdagent: Unregister input handler of mouse during finalization
Quoted 8 lines · On Thu, Aug 17, 2023 at 6:24 PM <[email protected]> wrote:
From: Guoyi Tu <[email protected]>
Input handler resource should be released when
VDAgentChardev object finalizeSigned-off-by Guoyi Tu <[email protected]>Signed-off-by dengpengcheng <[email protected]>
Quoted 22 lines
--- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+)ui/vdagent.c +3
-1@@ -926,6 +926,9 @@ static void vdagent_chr_fini(Object *obj)migrate_del_blocker (vd->migration_blocker);vdagent_disconnect (vd); +if (vd->mouse_hs) { +qemu_input_handler_unregister (vd->mouse_hs); + }buffer_free (&vd->outbuf);error_free (vd->migration_blocker); } --2.27.0
Signature · 1 line
Marc-André Lureau
Hi Gerd, what do you think of these two patches? Can they be merged into the upstream?
Quoted 11 lines · On 2023/8/17 22:12, [email protected] wrote:
From: Guoyi Tu <[email protected]>
and resource leak
Guoyi Tu (2):
ui/vdagent: callvdagent_disconnect()when agent connection is lost ui/vdagent: Unregister input handler of mouse during finalizationui/vdagent.c | 6 ++++++ 1 file changed, 6 insertions(+)
Hi
Quoted 3 lines · Guoyi Tu
Hi Gerd, what do you think of these two patches? Can they be merged into the upstream?
I'll queue them.
thanks
Signature · 1 line
Marc-André Lureau
Quoted 13 lines · Marc-André Lureau
Hi
Quoted 3 lines · Guoyi Tu
Hi Gerd, what do you think of these two patches? Can they be merged into the upstream?
I'll queue them.
thanks
I'm glad they can be merged. Thank you.