From nobody Sun Nov 9 11:35:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550843403909807.4806550061611; Fri, 22 Feb 2019 05:50:03 -0800 (PST) Received: from localhost ([127.0.0.1]:50956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBDE-0008O3-UQ for importer@patchew.org; Fri, 22 Feb 2019 08:50:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBBW-0007KL-Ho for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxBBV-0001j0-8G for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:14 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:56217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxBBU-0000id-9j for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:13 -0500 Received: from 62-165-147-230.co.dnainternet.fi ([62.165.147.230] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gxBAX-0007yp-3z; Fri, 22 Feb 2019 14:47:13 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gxBAJ-0006PP-Ax; Fri, 22 Feb 2019 15:46:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=0iPo2k3bH8pn4gRDYERDF4nATCAe/9vuWKzjs5OdYks=; b=Hi1LDl37AnDkgUS4ijRzEpxlKngpkVfZsDXks4WqGx2msbCY/CiDmUAVoVQlb2pQclMh7CmHVwWZ5wzcEaqoHmlxr7ywfrYKaZQqC8Eq9FGDSyYOow6TZwl3fjZ4l+jyPrDfuuxd+6HxEvZWFU3sladEoTHK5REAr95WFKnkOFwvVYRIhMUnOC5d8y31+M8cIa90PjavsdX4rKLMKFfEX8A95uqSW/ghqgE5uAoR0QD/JgFz1kjpkk5KjxWWkVQ59M+CPhfDbWj0LemEOhCmgFvs46WFa8UxakS73xrTKoz7LmatKd7Z9Lh5S2S+xrzURyMpksuJDTEqc4t5/BFk5w==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2019 15:46:24 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH v3 1/3] main-loop: Fix GSource leak in qio_task_thread_worker() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Alberto Garcia , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) After g_source_attach() the GMainContext holds a reference to the GSource, so the caller does not need to keep it. qio_task_thread_worker() is not releasing its reference so the GSource is being leaked since a17536c594bfed94d05667b419f747b692f5fc7f. Signed-off-by: Alberto Garcia Reviewed-by: Daniel P. Berrang=C3=A9 --- io/task.c | 1 + 1 file changed, 1 insertion(+) diff --git a/io/task.c b/io/task.c index 64c4c7126a..1ae7b86488 100644 --- a/io/task.c +++ b/io/task.c @@ -136,6 +136,7 @@ static gpointer qio_task_thread_worker(gpointer opaque) qio_task_thread_result, task, NULL); g_source_attach(task->thread->completion, task->thread->context); + g_source_unref(task->thread->completion); trace_qio_task_thread_source_attach(task, task->thread->completion); =20 qemu_cond_signal(&task->thread_cond); --=20 2.11.0 From nobody Sun Nov 9 11:35:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550843539273276.6193113753544; Fri, 22 Feb 2019 05:52:19 -0800 (PST) Received: from localhost ([127.0.0.1]:51006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBFQ-0001kE-89 for importer@patchew.org; Fri, 22 Feb 2019 08:52:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBBX-0007Kc-4e for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxBBV-0001jV-Fa for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:14 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:56216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxBBU-0000iU-Qy for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:13 -0500 Received: from 62-165-147-230.co.dnainternet.fi ([62.165.147.230] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gxBAX-0007yq-5h; Fri, 22 Feb 2019 14:47:13 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gxBAJ-0006PR-Bp; Fri, 22 Feb 2019 15:46:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=f3BhRVPQ3hGls1rc/lcSFfieFOOaV3dzTmMRC/Io8+0=; b=JqetLdTvbSLip6u+h8kHgFTfYv9bg00V3n6V8KdG9ma9aEQpW8vtvZkkLh0jYIPK169FYixsKn1ma2ocK+8rRFo7G+mqG40raHMZpMSRMcU8v5r48RTVoGSLJATpFMg8kPBKD6CQ80JmuH8Jo2XOPBk8y441DXWjYFpyJG41lIG5eo2/k7ejWRj+NhC+FV0cCsMLTAiR/42B3vndR6x3ayIxBCFftA9eyFogQm9INL3DtqPmX2f7dvF+yv7Z6jI1bSxoa0VihFfI14SthB4GKBTmtRboL0vnIKmQUOqkiWnd8vd0jij0+ompLQ57GvzX8VIqZXCmoprgjfc2BSP9gQ==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2019 15:46:25 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH v3 2/3] main-loop: Add qemu_idle_add() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Alberto Garcia , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This works like g_idle_add() but allows specifying a different GMainContext. It also returns the GSource directly instead of its ID number for convenience. qio_task_thread_worker() is modified to make use of this new function. Signed-off-by: Alberto Garcia Reviewed-by: Daniel P. Berrang=C3=A9 --- include/qemu/main-loop.h | 12 ++++++++++++ io/task.c | 10 +++------- util/main-loop.c | 9 +++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h index f6ba78ea73..f966c015d0 100644 --- a/include/qemu/main-loop.h +++ b/include/qemu/main-loop.h @@ -295,6 +295,18 @@ void qemu_mutex_lock_iothread_impl(const char *file, i= nt line); */ void qemu_mutex_unlock_iothread(void); =20 +/** + * qemu_idle_add: Add an idle function to a GMainContext + * + * This function is similar to GLib's g_idle_add() but it allows + * specifying a GMainContext instead of using the global one. + * + * The returned GSource is owned by the GMainContext and is deleted + * automatically after @func returns false. It can also be deleted by + * removing it from the GMainContext using g_source_destroy(). + */ +GSource *qemu_idle_add(GSourceFunc func, gpointer data, GMainContext *ctx); + /* internal interfaces */ =20 void qemu_fd_register(int fd); diff --git a/io/task.c b/io/task.c index 1ae7b86488..16754e22ba 100644 --- a/io/task.c +++ b/io/task.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/main-loop.h" #include "io/task.h" #include "qapi/error.h" #include "qemu/thread.h" @@ -130,13 +131,8 @@ static gpointer qio_task_thread_worker(gpointer opaque) trace_qio_task_thread_exit(task); =20 qemu_mutex_lock(&task->thread_lock); - - task->thread->completion =3D g_idle_source_new(); - g_source_set_callback(task->thread->completion, - qio_task_thread_result, task, NULL); - g_source_attach(task->thread->completion, - task->thread->context); - g_source_unref(task->thread->completion); + task->thread->completion =3D qemu_idle_add(qio_task_thread_result, tas= k, + task->thread->context); trace_qio_task_thread_source_attach(task, task->thread->completion); =20 qemu_cond_signal(&task->thread_cond); diff --git a/util/main-loop.c b/util/main-loop.c index d4a521caeb..e23eda68cc 100644 --- a/util/main-loop.c +++ b/util/main-loop.c @@ -171,6 +171,15 @@ int qemu_init_main_loop(Error **errp) return 0; } =20 +GSource *qemu_idle_add(GSourceFunc func, gpointer data, GMainContext *ctx) +{ + GSource *idle =3D g_idle_source_new(); + g_source_set_callback(idle, func, data, NULL); + g_source_attach(idle, ctx); + g_source_unref(idle); + return idle; +} + static int max_priority; =20 #ifndef _WIN32 --=20 2.11.0 From nobody Sun Nov 9 11:35:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550843540090332.72818307596106; Fri, 22 Feb 2019 05:52:20 -0800 (PST) Received: from localhost ([127.0.0.1]:51008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBFQ-0001kd-VI for importer@patchew.org; Fri, 22 Feb 2019 08:52:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gxBBX-0007Kf-KQ for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gxBBV-0001jG-9E for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:15 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:56218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gxBBU-0000ic-GP for qemu-devel@nongnu.org; Fri, 22 Feb 2019 08:48:13 -0500 Received: from 62-165-147-230.co.dnainternet.fi ([62.165.147.230] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gxBAX-0007ys-7R; Fri, 22 Feb 2019 14:47:13 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gxBAJ-0006PT-Cj; Fri, 22 Feb 2019 15:46:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=wwwYObyQQglCF+PKULsz7D73vI/9oKchURnKdOTgEeM=; b=iAo6uzkZMjKd3j9SAiADjdCbUBYrn+jOrIblIJXrEgcTQTTW/F+w9zCejWH4Tzf03VTptLNBZGJJ4/nqborZCoo+dnmF9pDtsdbREJlklm6yts4muu71e3OiL0TaGoiNsWqiq4KwAboyT7ukGAhR/Se2Ce18HHE3ixpO5/+L6YlkSQjleu6qEVWNYmeE93DQUFrCjHlPt2Uie+ze2gk/n2nywWvyYWZLoJYO5MyKt7s7dRJy43oWKzV6L9KfDMt1RB0YUWMilhiMNGFNdwOoKJj31BizwiNt/YATOJBbaZXCQnj9uh5EHIiECms6tLyYdRA9/0nBv1bnWVenLrfbog==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 22 Feb 2019 15:46:26 +0200 Message-Id: <48f7e50413f6f222acb1bf3a9de773e387a2855a.1550842915.git.berto@igalia.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH v3 3/3] char-socket: Lock tcp_chr_disconnect() and socket_reconnect_timeout() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Alberto Garcia , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" There's a race condition in which the tcp_chr_read() ioc handler can close a connection that is being written to from another thread. Running iotest 136 in a loop triggers this problem and crashes QEMU. (gdb) bt #0 0x00005558b842902d in object_get_class (obj=3D0x0) at qom/object.c:860 #1 0x00005558b84f92db in qio_channel_writev_full (ioc=3D0x0, iov=3D0x7ffc= 355decf0, niov=3D1, fds=3D0x0, nfds=3D0, errp=3D0x0) at io/channel.c:76 #2 0x00005558b84e0e9e in io_channel_send_full (ioc=3D0x0, buf=3D0x5558baf= 5beb0, len=3D138, fds=3D0x0, nfds=3D0) at chardev/char-io.c:123 #3 0x00005558b84e4a69 in tcp_chr_write (chr=3D0x5558ba460380, buf=3D0x555= 8baf5beb0 "...", len=3D138) at chardev/char-socket.c:135 #4 0x00005558b84dca55 in qemu_chr_write_buffer (s=3D0x5558ba460380, buf= =3D0x5558baf5beb0 "...", len=3D138, offset=3D0x7ffc355dedd0, write_all=3Dfa= lse) at chardev/char.c:112 #5 0x00005558b84dcbc2 in qemu_chr_write (s=3D0x5558ba460380, buf=3D0x5558= baf5beb0 "...", len=3D138, write_all=3Dfalse) at chardev/char.c:147 #6 0x00005558b84dfb26 in qemu_chr_fe_write (be=3D0x5558ba476610, buf=3D0x= 5558baf5beb0 "...", len=3D138) at chardev/char-fe.c:42 #7 0x00005558b8088c86 in monitor_flush_locked (mon=3D0x5558ba476610) at m= onitor.c:406 #8 0x00005558b8088e8c in monitor_puts (mon=3D0x5558ba476610, str=3D0x5558= ba921e49 "") at monitor.c:449 #9 0x00005558b8089178 in qmp_send_response (mon=3D0x5558ba476610, rsp=3D0= x5558bb161600) at monitor.c:498 #10 0x00005558b808920c in monitor_qapi_event_emit (event=3DQAPI_EVENT_SHUT= DOWN, qdict=3D0x5558bb161600) at monitor.c:526 #11 0x00005558b8089307 in monitor_qapi_event_queue_no_reenter (event=3DQAP= I_EVENT_SHUTDOWN, qdict=3D0x5558bb161600) at monitor.c:551 #12 0x00005558b80896c0 in qapi_event_emit (event=3DQAPI_EVENT_SHUTDOWN, qd= ict=3D0x5558bb161600) at monitor.c:626 #13 0x00005558b855f23b in qapi_event_send_shutdown (guest=3Dfalse, reason= =3DSHUTDOWN_CAUSE_HOST_QMP_QUIT) at qapi/qapi-events-run-state.c:43 #14 0x00005558b81911ef in qemu_system_shutdown (cause=3DSHUTDOWN_CAUSE_HOS= T_QMP_QUIT) at vl.c:1837 #15 0x00005558b8191308 in main_loop_should_exit () at vl.c:1885 #16 0x00005558b819140d in main_loop () at vl.c:1924 #17 0x00005558b8198c84 in main (argc=3D18, argv=3D0x7ffc355df3f8, envp=3D0= x7ffc355df490) at vl.c:4665 This patch adds a lock to protect tcp_chr_disconnect() and socket_reconnect_timeout() Signed-off-by: Alberto Garcia Reviewed-by: Daniel P. Berrang=C3=A9 --- chardev/char-socket.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 4fcdd8aedd..94522777dc 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -148,7 +148,7 @@ static void tcp_chr_accept(QIONetListener *listener, void *opaque); =20 static int tcp_chr_read_poll(void *opaque); -static void tcp_chr_disconnect(Chardev *chr); +static void tcp_chr_disconnect_locked(Chardev *chr); =20 /* Called with chr_write_lock held. */ static int tcp_chr_write(Chardev *chr, const uint8_t *buf, int len) @@ -172,7 +172,7 @@ static int tcp_chr_write(Chardev *chr, const uint8_t *b= uf, int len) =20 if (ret < 0 && errno !=3D EAGAIN) { if (tcp_chr_read_poll(chr) <=3D 0) { - tcp_chr_disconnect(chr); + tcp_chr_disconnect_locked(chr); return len; } /* else let the read handler finish it properly */ } @@ -464,11 +464,19 @@ static void update_disconnected_filename(SocketCharde= v *s) } } =20 +static gboolean tcp_chr_be_event_closed(gpointer opaque) +{ + Chardev *chr =3D opaque; + qemu_chr_be_event(chr, CHR_EVENT_CLOSED); + return FALSE; +} + /* NB may be called even if tcp_chr_connect has not been * reached, due to TLS or telnet initialization failure, * so can *not* assume s->state =3D=3D TCP_CHARDEV_STATE_CONNECTED + * This must be called with chr->chr_write_lock held. */ -static void tcp_chr_disconnect(Chardev *chr) +static void tcp_chr_disconnect_locked(Chardev *chr) { SocketChardev *s =3D SOCKET_CHARDEV(chr); bool emit_close =3D s->state =3D=3D TCP_CHARDEV_STATE_CONNECTED; @@ -481,13 +489,20 @@ static void tcp_chr_disconnect(Chardev *chr) } update_disconnected_filename(s); if (emit_close) { - qemu_chr_be_event(chr, CHR_EVENT_CLOSED); + qemu_idle_add(tcp_chr_be_event_closed, chr, chr->gcontext); } if (s->reconnect_time) { qemu_chr_socket_restart_timer(chr); } } =20 +static void tcp_chr_disconnect(Chardev *chr) +{ + qemu_mutex_lock(&chr->chr_write_lock); + tcp_chr_disconnect_locked(chr); + qemu_mutex_unlock(&chr->chr_write_lock); +} + static gboolean tcp_chr_read(QIOChannel *chan, GIOCondition cond, void *op= aque) { Chardev *chr =3D CHARDEV(opaque); @@ -1128,8 +1143,10 @@ static gboolean socket_reconnect_timeout(gpointer op= aque) Chardev *chr =3D CHARDEV(opaque); SocketChardev *s =3D SOCKET_CHARDEV(opaque); =20 + qemu_mutex_lock(&chr->chr_write_lock); g_source_unref(s->reconnect_timer); s->reconnect_timer =3D NULL; + qemu_mutex_unlock(&chr->chr_write_lock); =20 if (chr->be_open) { return false; --=20 2.11.0