From patchwork Fri Sep 28 07:58:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Bumiller X-Patchwork-Id: 10619097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC6A114BD for ; Fri, 28 Sep 2018 07:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5D762AD77 for ; Fri, 28 Sep 2018 07:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 997452AD89; Fri, 28 Sep 2018 07:59:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 194A32AD77 for ; Fri, 28 Sep 2018 07:59:29 +0000 (UTC) Received: from localhost ([::1]:41869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5ngN-0003QY-UE for patchwork-qemu-devel@patchwork.kernel.org; Fri, 28 Sep 2018 03:59:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5nfe-0002oE-HR for qemu-devel@nongnu.org; Fri, 28 Sep 2018 03:58:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5nfb-0002Kc-3Q for qemu-devel@nongnu.org; Fri, 28 Sep 2018 03:58:42 -0400 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:42353) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5nfa-0002GY-R2 for qemu-devel@nongnu.org; Fri, 28 Sep 2018 03:58:39 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 4D8F24234B; Fri, 28 Sep 2018 09:58:33 +0200 (CEST) From: Wolfgang Bumiller To: qemu-devel@nongnu.org Date: Fri, 28 Sep 2018 09:58:31 +0200 Message-Id: <20180928075832.18586-2-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180928075832.18586-1-w.bumiller@proxmox.com> References: <20180928075832.18586-1-w.bumiller@proxmox.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.186.127.180 Subject: [Qemu-devel] [PATCH v2 1/2] monitor: guard iothread access by mon->use_io_thread 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: Markus Armbruster , Peter Xu , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- No changes in this patch. monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index c4677b502b..d47e4259fd 100644 --- a/monitor.c +++ b/monitor.c @@ -4285,7 +4285,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.