From patchwork Fri Sep 28 07:58:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Bumiller X-Patchwork-Id: 976077 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 42M3y83F50z9s3x for ; Fri, 28 Sep 2018 18:00:32 +1000 (AEST) Received: from localhost ([::1]:41873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5nhO-000457-0F for incoming@patchwork.ozlabs.org; Fri, 28 Sep 2018 04:00:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5nfe-0002oG-Ib 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-0002Kh-3p for qemu-devel@nongnu.org; Fri, 28 Sep 2018 03:58:42 -0400 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:56320) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5nfa-0002Gi-R1 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 8873E41F74; Fri, 28 Sep 2018 09:58:33 +0200 (CEST) From: Wolfgang Bumiller To: qemu-devel@nongnu.org Date: Fri, 28 Sep 2018 09:58:30 +0200 Message-Id: <20180928075832.18586-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] [fuzzy] X-Received-From: 212.186.127.180 Subject: [Qemu-devel] [PATCH v2 0/2] delay monitor iothread creation 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" The early monitor iothread creation conflicts with the -daemonize option causing crashes at shutdown of a daemonized qemu instance. These patches will delay the creation to when a monitor using it is actually spawned. While the second patch depends on the first one, the first is a consistency cleanup on its own, therefore split out. v2: This version incorporates Markus Armbruster's requested change to protect mon_iothread initialization by monitor_lock (and moves the variable declaration to reflect this), and adds a comments about monitor_init() expecting to be run in the main thread. Wolfgang Bumiller (2): monitor: guard iothread access by mon->use_io_thread monitor: delay monitor iothread creation monitor.c | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-)