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: 976076 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 42M3wY1v4Dz9s3x for ; Fri, 28 Sep 2018 17:59:09 +1000 (AEST) Received: from localhost ([::1]:41868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5ng2-0002p7-Bs for incoming@patchwork.ozlabs.org; Fri, 28 Sep 2018 03:59:06 -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+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 --- 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.