From patchwork Thu Aug 17 14:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guoyi Tu X-Patchwork-Id: 13356546 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2145C30630 for ; Thu, 17 Aug 2023 14:23:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWdtg-0003u9-N4; Thu, 17 Aug 2023 10:22:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWdtd-0003so-8m for qemu-devel@nongnu.org; Thu, 17 Aug 2023 10:22:45 -0400 Received: from smtpnm6-06.21cn.com ([182.42.144.170] helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWdta-0004kG-HW for qemu-devel@nongnu.org; Thu, 17 Aug 2023 10:22:45 -0400 HMM_SOURCE_IP: 192.168.138.117:19873.1524632281 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-182.148.58.152 (unknown [192.168.138.117]) by chinatelecom.cn (HERMES) with SMTP id DC155E821C; Thu, 17 Aug 2023 22:13:58 +0800 (CST) X-189-SAVE-TO-SEND: +tugy@chinatelecom.cn Received: from ([182.148.58.152]) by gateway-ssl-dep-56d86dc765-7s8sf with ESMTP id 1fe151063b5842989e06f5ba66ba1b57 for kraxel@redhat.com; Thu, 17 Aug 2023 22:14:00 CST X-Transaction-ID: 1fe151063b5842989e06f5ba66ba1b57 X-Real-From: tugy@chinatelecom.cn X-Receive-IP: 182.148.58.152 X-MEDUSA-Status: 0 From: tugy@chinatelecom.cn To: kraxel@redhat.com, marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org, tugy@chinatelecom.cn, dengpc12@chinatelecom.cn Subject: [PATCH v1 1/2] ui/vdagent: call vdagent_disconnect() when agent connection is lost Date: Thu, 17 Aug 2023 22:12:52 +0800 Message-Id: <71fd5a58fd09f10cdb35f167b2edb5669300116e.1692281173.git.tugy@chinatelecom.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=182.42.144.170; envelope-from=tugy@chinatelecom.cn; helo=chinatelecom.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Guoyi Tu 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 Signed-off-by: Guoyi Tu Signed-off-by: dengpengcheng Reviewed-by: Marc-André Lureau --- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vdagent.c b/ui/vdagent.c index 8a651492f0..4b9a1fb7c5 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -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); From patchwork Thu Aug 17 14:12:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guoyi Tu X-Patchwork-Id: 13356547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3195EC2FC3D for ; Thu, 17 Aug 2023 14:23:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWdtg-0003tm-50; Thu, 17 Aug 2023 10:22:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWdte-0003t9-Vd for qemu-devel@nongnu.org; Thu, 17 Aug 2023 10:22:46 -0400 Received: from smtpnm6-06.21cn.com ([182.42.144.170] helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWdtb-0004kB-7u for qemu-devel@nongnu.org; Thu, 17 Aug 2023 10:22:46 -0400 HMM_SOURCE_IP: 192.168.138.117:19873.1524632281 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-182.148.58.152 (unknown [192.168.138.117]) by chinatelecom.cn (HERMES) with SMTP id 85F9DE821D; Thu, 17 Aug 2023 22:14:01 +0800 (CST) X-189-SAVE-TO-SEND: +tugy@chinatelecom.cn Received: from ([182.148.58.152]) by gateway-ssl-dep-56d86dc765-7s8sf with ESMTP id 56cf0b8c26b54df5809d00c89f1c2bb2 for kraxel@redhat.com; Thu, 17 Aug 2023 22:14:02 CST X-Transaction-ID: 56cf0b8c26b54df5809d00c89f1c2bb2 X-Real-From: tugy@chinatelecom.cn X-Receive-IP: 182.148.58.152 X-MEDUSA-Status: 0 From: tugy@chinatelecom.cn To: kraxel@redhat.com, marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org, tugy@chinatelecom.cn, dengpc12@chinatelecom.cn Subject: [PATCH v1 2/2] ui/vdagent: Unregister input handler of mouse during finalization Date: Thu, 17 Aug 2023 22:12:53 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=182.42.144.170; envelope-from=tugy@chinatelecom.cn; helo=chinatelecom.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Guoyi Tu Input handler resource should be released when VDAgentChardev object finalize Signed-off-by: Guoyi Tu Signed-off-by: dengpengcheng Reviewed-by: Marc-André Lureau --- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vdagent.c b/ui/vdagent.c index 4b9a1fb7c5..00d36a8677 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -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); }