From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHZVL-00031G-2K for qemu-devel@nongnu.org; Tue, 30 Oct 2018 15:16:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHZVH-0005r1-VQ for qemu-devel@nongnu.org; Tue, 30 Oct 2018 15:16:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59863) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHZVH-0005iv-Kh for qemu-devel@nongnu.org; Tue, 30 Oct 2018 15:16:39 -0400 From: Markus Armbruster Date: Tue, 30 Oct 2018 20:16:13 +0100 Message-Id: <20181030191620.32168-2-armbru@redhat.com> In-Reply-To: <20181030191620.32168-1-armbru@redhat.com> References: <20181030191620.32168-1-armbru@redhat.com> Subject: [Qemu-devel] [PULL 1/8] monitor: guard iothread access by mon->use_io_thread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Wolfgang Bumiller From: Wolfgang Bumiller monitor_resume() and monitor_suspend() both want to "kick" the I/O thread if it is there, but in monitor_suspend() lacked the use_io_thread flag condition. This is required when we later only spawn the thread on first use. Signed-off-by: Wolfgang Bumiller Reviewed-by: Eric Blake Reviewed-by: Peter Xu Message-Id: <20180925081507.11873-2-w.bumiller@proxmox.com> Signed-off-by: Markus Armbruster --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 823b5a1099..66f149c1dc 100644 --- a/monitor.c +++ b/monitor.c @@ -4292,7 +4292,7 @@ int monitor_suspend(Monitor *mon) atomic_inc(&mon->suspend_cnt); - if (monitor_is_qmp(mon)) { + if (monitor_is_qmp(mon) && mon->use_io_thread) { /* * Kick I/O thread to make sure this takes effect. It'll be * evaluated again in prepare() of the watch object. -- 2.17.2