From nobody Mon Feb 9 16:12:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591017743; cv=none; d=zohomail.com; s=zohoarc; b=D2qdiASs1r+VzxcgQ4+ssTrUjSm6YcF0NikGNDvXxjn4KSFGqeeGu44JYcGWmtkblQHQEfhSQy4AZrTq38Xznx+LHz1bzfytG+Zy0iN6X2GuB2FY1LR7P1RssE80qwPSaabw9EsKqsn49ai8HowYnWkk7yEioJDwJmZTT+ZpXBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591017743; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oLmmrla+pRXIGo0fpJFFeHgXjhoEbJFS0KQkLs4PCdc=; b=KjKV2KAvpj0EG4mo2svcN4Lv3TIVZlBrdSlhSUm6fuESek9WZMH075KlGi3DI/VetBnJN0WR6USkk7tJZYdxNcRf5hbRqFVBtSr6ovEPtC1uHSpxjy6Ip4o0/vNIjW+VIBSwO6Xl9wkrQzGXRLwX9A6yEw+5z4tDTbjfqjOz6pM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1591017743822200.61629927454135; Mon, 1 Jun 2020 06:22:23 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jfkOK-0006f4-LQ; Mon, 01 Jun 2020 13:22:12 +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.92) (envelope-from ) id 1jfkOJ-0006eX-Se for xen-devel@lists.xenproject.org; Mon, 01 Jun 2020 13:22:11 +0000 Received: from mga12.intel.com (unknown [192.55.52.136]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id dea7aff3-a40a-11ea-ab1b-12813bfff9fa; Mon, 01 Jun 2020 13:21:59 +0000 (UTC) Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2020 06:21:57 -0700 Received: from alayek-mobl.amr.corp.intel.com (HELO ubuntu.localdomain) ([10.209.11.99]) by orsmga008.jf.intel.com with ESMTP; 01 Jun 2020 06:21:57 -0700 X-Inumbo-ID: dea7aff3-a40a-11ea-ab1b-12813bfff9fa IronPort-SDR: ExGWDZMH5GWwQEkJjcFMcIanFAIhhumLpPK09RcYRo00igFeixwnxOyffCGITwYPRMc2ZfeJrJ VJJc76bbQ2/g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: AAatOggz3HYKUTbjHTpoBX7UjXaEbcFir0FwqigBWNA8hm4nXhBOwsx5nL1oNXc1iPQidkp7gn YQY/Qpjej3yA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,460,1583222400"; d="scan'208";a="303887289" From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Subject: [PATCH v19 for-4.14 07/13] tools/libxl: Adjust libxl__build_pre Date: Mon, 1 Jun 2020 06:21:41 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Tamas K Lengyel , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" Skips parts not relevant for VM forks. No functional change in existing cod= e, only relocating some bits that don't need to be done at the very end. Signed-off-by: Tamas K Lengyel --- tools/libxl/libxl_dom.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index dd1aff89a3..1b55097a1a 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -249,9 +249,12 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, libxl_domain_build_info *const info =3D &d_config->b_info; libxl_ctx *ctx =3D libxl__gc_owner(gc); char *xs_domid, *con_domid; - int rc; + int rc =3D 0; uint64_t size; =20 + if (state->forked_vm) + goto skip_fork; + if (xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus) !=3D 0) { LOG(ERROR, "Couldn't set max vcpu count"); return ERROR_FAIL; @@ -374,6 +377,16 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, return ERROR_FAIL; } =20 + if ( (rc =3D libxl__arch_domain_create(gc, d_config, domid)) ) + return rc; + + /* Construct a CPUID policy, but only for brand new domains. Domains + * being migrated-in/restored have CPUID handled during the + * static_data_done() callback. */ + if (!state->restore) + libxl__cpuid_legacy(ctx, domid, info); + +skip_fork: xs_domid =3D xs_read(ctx->xsh, XBT_NULL, "/tool/xenstored/domid", NULL= ); state->store_domid =3D xs_domid ? atoi(xs_domid) : 0; free(xs_domid); @@ -385,14 +398,6 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, state->store_port =3D xc_evtchn_alloc_unbound(ctx->xch, domid, state->= store_domid); state->console_port =3D xc_evtchn_alloc_unbound(ctx->xch, domid, state= ->console_domid); =20 - rc =3D libxl__arch_domain_create(gc, d_config, domid); - - /* Construct a CPUID policy, but only for brand new domains. Domains - * being migrated-in/restored have CPUID handled during the - * static_data_done() callback. */ - if (!state->restore) - libxl__cpuid_legacy(ctx, domid, info); - return rc; } =20 --=20 2.25.1