From patchwork Fri Mar 13 11:25:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pawe=C5=82_Marczewski?= X-Patchwork-Id: 11436745 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C149792A for ; Fri, 13 Mar 2020 11:26:18 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D70D2072C for ; Fri, 13 Mar 2020 11:26:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="sEyqs9jK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D70D2072C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jCiRO-00081s-Py; Fri, 13 Mar 2020 11:25:22 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jCiRN-00081g-GN for xen-devel@lists.xenproject.org; Fri, 13 Mar 2020 11:25:21 +0000 X-Inumbo-ID: 528e95fc-651d-11ea-b2c4-12813bfff9fa Received: from out4-smtp.messagingengine.com (unknown [66.111.4.28]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 528e95fc-651d-11ea-b2c4-12813bfff9fa; Fri, 13 Mar 2020 11:25:20 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 06CA8226B4; Fri, 13 Mar 2020 07:25:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 13 Mar 2020 07:25:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=zzhOeL cLCNfp5McXrz+vySJLo0DljT5Z4GNhQjlwPyQ=; b=sEyqs9jKPrtGb/sfsqIEve BoqFFhCaqtjrPrE+gzTQZRNyHkypgRA/unAeL1v1kgggo4M6m1/aeDSsFmq6RtZu wSU6Uy0jNGSPvnbhaRJuip1DRaKEHq2iuWAFVQL9wwsraN/6I5jNQzxYO1QMEqDR SFixzX8SwnSkw+rDJWmq3XakVtaDwlTH/x5UxiuAi3D8zgFVMOtilVLrMxLmW7mq xY+Yy7ZtvAgd1A/2buqGCQjp6hiAGGMucUJ6540oDc7qoMnT45suoBcg7k6J18m1 Hcc6u17x8Vc41ra7hFiwYMa+tf1MVWt12By4VMfbcNCyg4y9MY0+2jE1oZv7fNeg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvjedgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffogggtgfesthekredtredtjeenucfhrhhomheprfgrfigvlhcu ofgrrhgtiigvfihskhhiuceophgrfigvlhesihhnvhhishhisghlvghthhhinhhgshhlrg gsrdgtohhmqeenucffohhmrghinhepthhrohhusghlvgdrthhoohhlshenucfkphepkeel rdeigedrjeekrdduleejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphgrfigvlhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Received: from localhost.localdomain (89-64-78-197.dynamic.chello.pl [89.64.78.197]) by mail.messagingengine.com (Postfix) with ESMTPA id 873263280059; Fri, 13 Mar 2020 07:25:18 -0400 (EDT) From: =?utf-8?q?Pawe=C5=82_Marczewski?= To: xen-devel@lists.xenproject.org Date: Fri, 13 Mar 2020 12:25:10 +0100 Message-Id: X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH] libxl: fix cleanup bug in initiate_domain_create() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , =?utf-8?q?Pawe=C5=82_Marczew?= =?utf-8?q?ski?= , Ian Jackson , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In case of errors, we immediately call domcreate_complete() which cleans up the console_xswait object. Make sure it is initialized before we start cleanup. Signed-off-by: Paweł Marczewski Reviewed-by: Ian Jackson --- This is a follow up to my previous patch, 'libxl: wait for console path before firing console_available'. We discovered the bug when running integration tests for Qubes OS (and verified that this patch helps). Sorry for the trouble. tools/libxl/libxl_create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index ada942bc8d..fc36c4263d 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -1102,6 +1102,8 @@ static void initiate_domain_create(libxl__egc *egc, libxl_domain_config *const d_config = dcs->guest_config; const int restore_fd = dcs->restore_fd; + libxl__xswait_init(&dcs->console_xswait); + domid = dcs->domid; libxl__domain_build_state_init(&dcs->build_state); @@ -1153,8 +1155,6 @@ static void initiate_domain_create(libxl__egc *egc, if (ret) goto error_out; - libxl__xswait_init(&dcs->console_xswait); - if (restore_fd >= 0 || dcs->soft_reset) { LOGD(DEBUG, domid, "restoring, not running bootloader"); domcreate_bootloader_done(egc, &dcs->bl, 0);