From patchwork Thu Jan 21 16:51:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 8083221 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EEB329F6FA for ; Thu, 21 Jan 2016 16:55:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 235DF204A0 for ; Thu, 21 Jan 2016 16:55:40 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C7C62039E for ; Thu, 21 Jan 2016 16:55:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMITw-0003v4-26; Thu, 21 Jan 2016 16:53:12 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aMITu-0003ui-DP for xen-devel@lists.xenproject.org; Thu, 21 Jan 2016 16:53:10 +0000 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id FF/81-12889-5FC01A65; Thu, 21 Jan 2016 16:53:09 +0000 X-Env-Sender: prvs=8211775ec=roger.pau@citrix.com X-Msg-Ref: server-6.tower-27.messagelabs.com!1453395187!18556810!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 486 invoked from network); 21 Jan 2016 16:53:08 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 21 Jan 2016 16:53:08 -0000 X-IronPort-AV: E=Sophos;i="5.22,326,1449532800"; d="scan'208";a="326845828" From: Roger Pau Monne To: Date: Thu, 21 Jan 2016 17:51:29 +0100 Message-ID: <1453395092-88090-4-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 1.9.5 (Apple Git-50.3) In-Reply-To: <1453395092-88090-1-git-send-email-roger.pau@citrix.com> References: <1453395092-88090-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Wei Liu , Ian Jackson , Ian Campbell , Roger Pau Monne Subject: [Xen-devel] [PATCH v4 3/6] libxl: initialise the build info before calling prepare_config X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP libxl__arch_domain_prepare_config has access to the libxl_domain_build_info struct, so make sure it's properly initialised. Note that prepare_config is called from within libxl__domain_make. This is not a bug at the moment, because prepare_config doesn't access libxl_domain_build_info yet, but this is likely going to change. Signed-off-by: Roger Pau Monné Acked-by: Ian Campbell --- Cc: Ian Jackson Cc: Ian Campbell Cc: Wei Liu --- Changes since v3: - Reword commit message to make it clear that prepare_config is called from domain_make, and that the fact that build_info is not initialised is not a bug ATM because prepare_config doesn't make use of it. --- tools/libxl/libxl_create.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index b669359..c7700a7 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -892,6 +892,12 @@ static void initiate_domain_create(libxl__egc *egc, goto error_out; } + ret = libxl__domain_build_info_setdefault(gc, &d_config->b_info); + if (ret) { + LOG(ERROR, "Unable to set domain build info defaults"); + goto error_out; + } + ret = libxl__domain_make(gc, d_config, &domid, &state->config); if (ret) { LOG(ERROR, "cannot make domain: %d", ret); @@ -903,12 +909,6 @@ static void initiate_domain_create(libxl__egc *egc, dcs->guest_domid = domid; dcs->dmss.dm.guest_domid = 0; /* means we haven't spawned */ - ret = libxl__domain_build_info_setdefault(gc, &d_config->b_info); - if (ret) { - LOG(ERROR, "Unable to set domain build info defaults"); - goto error_out; - } - if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM && (libxl_defbool_val(d_config->b_info.u.hvm.nested_hvm) && libxl_defbool_val(d_config->b_info.u.hvm.altp2m))) {