From patchwork Fri Sep 21 08:28:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Bumiller X-Patchwork-Id: 972955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=proxmox.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42GnQB2SdYz9sC7 for ; Fri, 21 Sep 2018 18:51:30 +1000 (AEST) Received: from localhost ([::1]:54557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3H9r-00011Z-MQ for incoming@patchwork.ozlabs.org; Fri, 21 Sep 2018 04:51:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GoB-0005HX-1V for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:29:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3Go7-0003JG-S7 for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:29:02 -0400 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:18528) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g3Go7-0003HJ-JG for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:28:59 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id A322741A6A; Fri, 21 Sep 2018 10:28:57 +0200 (CEST) From: Wolfgang Bumiller To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 10:28:55 +0200 Message-Id: <20180921082856.1000-1-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.186.127.180 Subject: [Qemu-devel] [PATCH 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 021c11b1bf..4802148c82 100644 --- a/monitor.c +++ b/monitor.c @@ -4380,7 +4380,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.