From patchwork Thu Dec 15 00:44:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 705909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 3tfGbM2VCWz9t0q for ; Thu, 15 Dec 2016 12:49:51 +1100 (AEDT) Received: from localhost ([::1]:51488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHLB7-0004h4-9x for incoming@patchwork.ozlabs.org; Wed, 14 Dec 2016 20:49:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHKCS-00056f-Fw for qemu-devel@nongnu.org; Wed, 14 Dec 2016 19:47:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHKCP-0001jt-Bn for qemu-devel@nongnu.org; Wed, 14 Dec 2016 19:47:08 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45171) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cHKCP-0001jK-1K for qemu-devel@nongnu.org; Wed, 14 Dec 2016 19:47:05 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uBF0hb8e056498 for ; Wed, 14 Dec 2016 19:47:04 -0500 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0a-001b2d01.pphosted.com with ESMTP id 27bdm90wx4-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 14 Dec 2016 19:47:03 -0500 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Dec 2016 17:47:03 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 14 Dec 2016 17:47:00 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 3F0D71FF0021; Wed, 14 Dec 2016 17:46:38 -0700 (MST) Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uBF0kxlg15401320; Wed, 14 Dec 2016 17:46:59 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E8106A03C; Wed, 14 Dec 2016 17:46:59 -0700 (MST) Received: from localhost (unknown [9.80.108.238]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id 4B94B6A03B; Wed, 14 Dec 2016 17:46:59 -0700 (MST) From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 14 Dec 2016 18:44:58 -0600 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481762701-4587-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1481762701-4587-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16121500-0028-0000-0000-0000064354F2 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006250; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000196; SDB=6.00793944; UDB=6.00384987; IPR=6.00571750; BA=6.00004968; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013630; XFM=3.00000011; UTC=2016-12-15 00:47:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16121500-0029-0000-0000-000031A90995 Message-Id: <1481762701-4587-65-git-send-email-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-14_15:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1612150008 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 64/67] vl: Delay initialization of memory backends 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: qemu-stable@nongnu.org, Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost Initialization of memory backends may take a while when prealloc=yes is used, depending on their size. Initializing memory backends before chardevs may delay the creation of monitor sockets, and trigger timeouts on management software that waits until the monitor socket is created by QEMU. See, for example, the bug report at: https://bugzilla.redhat.com/show_bug.cgi?id=1371211 In addition to that, allocating memory before calling configure_accelerator() breaks the tcg_enabled() checks at memory_region_init_*(). This patch fixes those problems by adding "memory-backend-*" classes to the delayed-initialization list. Signed-off-by: Eduardo Habkost (cherry picked from commit 6546d0dba6c211c1a3eac1252a4f50a0c151a08a) Signed-off-by: Michael Roth --- vl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vl.c b/vl.c index 3414e1a..6a218ce 100644 --- a/vl.c +++ b/vl.c @@ -2811,6 +2811,19 @@ static bool object_create_initial(const char *type) return false; } + /* Memory allocation by backends needs to be done + * after configure_accelerator() (due to the tcg_enabled() + * checks at memory_region_init_*()). + * + * Also, allocation of large amounts of memory may delay + * chardev initialization for too long, and trigger timeouts + * on software that waits for a monitor socket to be created + * (e.g. libvirt). + */ + if (g_str_has_prefix(type, "memory-backend-")) { + return false; + } + return true; }