From nobody Mon Feb 9 11:29:42 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1571411370; cv=none; d=zoho.com; s=zohoarc; b=LqnQztnkNux1l+MSW1DHbj9+4DCZ6148rWhF/WOLaHlQDnZdT0yvRkmbTcl5utLFTLWbPiE8PtGq1AmJIV3j39xXQ6P0Ei5eiD+NoDstFs3iD8JcCfMoRmktK9NiJysC1r/u5VVgXCesUNOTnm0VDql0DYz04Ek5Ry6wt1lI8Zc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571411370; h=Content-Type: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=XB7iC9S/YUFYD1Tm5Eq5IS3y+MegVGJZfaGAQQGaF9E=; b=Ns2KyddelN/ndcBOxKvCKmn06dlJYTd+qrjT3WhBNkfAPxdRQr+fwx2Pkt67OAAiRZWRY+GpFl0sLVK9mc11HoVIV0ImPgvTRIDwYp6JkOfMa3c1e9n5ZwkRTnVeQuzVTlVWaMfsTwycDxkFnEAqO/WR2ggdvqzABI72GwhT9sE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 1571411370703491.4917862928037; Fri, 18 Oct 2019 08:09:30 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iLTqV-00054g-Uf; Fri, 18 Oct 2019 15:07:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iLTqU-00054D-Hs for xen-devel@lists.xenproject.org; Fri, 18 Oct 2019 15:07:14 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ef3f4032-f1b8-11e9-beca-bc764e2007e4; Fri, 18 Oct 2019 15:07:00 +0000 (UTC) X-Inumbo-ID: ef3f4032-f1b8-11e9-beca-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1571411220; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=1jKUJSikxB9yiqNmqcnpVueJx6HmmRvphhPyUj0dFVU=; b=gS4a1VAk6P3WaQsTCBd04wvj4aw3D13iCqFuqni7a9y04bARJVIwR0On lI7ZndHmRyZnZoFZaIFWstUBlr/OgZEcxGkVGZQHjwrL+1iSx0UUsbUWo 8vZiqmUnqFKG3LPVNUuudzd+SaAt+nEnykmHcSEaocCaz85t4PhaA7CsL I=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@eu.citrix.com; spf=Pass smtp.mailfrom=Ian.Jackson@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of ian.jackson@eu.citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="ian.jackson@eu.citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.hc3370-68.iphmx.com: domain of Ian.Jackson@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="Ian.Jackson@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa6.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa6.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: +WhMRasiYSJn4GUg5s3ARFnsrReYPOnnJS+Mh5D7JXTC++r/4iWnx3nZ5jXpih7WxyjlRm9g37 4mEPAMELT53ahHohWNIPwKZ0WUIUuzo6e+1q6QmbWb5/BUbBdVC29KxNvjF1Un2Td2GST+fD9p QhvKaCRbsCHeDWecwaum6bFiPHfuCPGGHGad2/Fvp2JiK2GPypK0uxNYeqJ8zbEtX61eBDT0KK 6MRhT3fPKQh8OO2kHAsKHGrRGyKIjr9WP8widub4+oXCkYvSoBmFEKSfuvg1PRHWCR+2zd0dAd SJE= X-SBRS: 2.7 X-MesageID: 7434355 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.67,312,1566878400"; d="scan'208";a="7434355" From: Ian Jackson To: Date: Fri, 18 Oct 2019 16:06:46 +0100 Message-ID: <20191018150653.24862-4-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191018150653.24862-1-ian.jackson@eu.citrix.com> References: <20191018150653.24862-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH for-4.13 v5 03/10] libxl: libxl__domain_config_setdefault: New function 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: Paul Durrant , Ian Jackson , Jan Beulich , Andrew Cooper Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Break out this into a new function. We are going to want to call it from a new call site. Unfortunately not all of the defaults can be moved into the new function without changing the order in which things are done. That does not seem wise at this stage of the release. The effect is that additional calls to libxl__domain_config_setdefault (which are going to be introduced) do not quite set everything. But they will do what is needed. After Xen 4.13 is done, we should move those settings into the right order. No functional change. Signed-off-by: Ian Jackson Reviewed-by: Anthony PERARD --- v2: Add missing error check --- tools/libxl/libxl_create.c | 41 +++++++++++++++++++++++++++++------------ tools/libxl/libxl_internal.h | 3 +++ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 099761a2d7..fd8bb22be9 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -862,22 +862,14 @@ static void domcreate_destruction_cb(libxl__egc *egc, libxl__domain_destroy_state *dds, int rc); =20 -static void initiate_domain_create(libxl__egc *egc, - libxl__domain_create_state *dcs) +int libxl__domain_config_setdefault(libxl__gc *gc, + libxl_domain_config *d_config, + uint32_t domid) { - STATE_AO_GC(dcs->ao); libxl_ctx *ctx =3D libxl__gc_owner(gc); - uint32_t domid; - int i, ret; + int ret; bool pod_enabled =3D false; =20 - /* convenience aliases */ - libxl_domain_config *const d_config =3D dcs->guest_config; - const int restore_fd =3D dcs->restore_fd; - - domid =3D dcs->domid_soft_reset; - libxl__domain_build_state_init(&dcs->build_state); - if (d_config->c_info.ssid_label) { char *s =3D d_config->c_info.ssid_label; ret =3D libxl_flask_context_to_sid(ctx, s, strlen(s), @@ -1008,6 +1000,28 @@ static void initiate_domain_create(libxl__egc *egc, goto error_out; } =20 + ret =3D 0; + error_out: + return ret; +} + +static void initiate_domain_create(libxl__egc *egc, + libxl__domain_create_state *dcs) +{ + STATE_AO_GC(dcs->ao); + uint32_t domid; + int i, ret; + + /* convenience aliases */ + libxl_domain_config *const d_config =3D dcs->guest_config; + const int restore_fd =3D dcs->restore_fd; + + domid =3D dcs->domid_soft_reset; + libxl__domain_build_state_init(&dcs->build_state); + + ret =3D libxl__domain_config_setdefault(gc,d_config,domid); + if (ret) goto error_out; + ret =3D libxl__domain_make(gc, d_config, &dcs->build_state, &domid); if (ret) { LOGD(ERROR, domid, "cannot make domain: %d", ret); @@ -1019,6 +1033,9 @@ static void initiate_domain_create(libxl__egc *egc, dcs->guest_domid =3D domid; dcs->sdss.dm.guest_domid =3D 0; /* means we haven't spawned */ =20 + /* post-4.13 todo: move these next bits of defaulting to + * libxl__domain_config_setdefault */ + /* * Set the dm version quite early so that libxl doesn't have to pass t= he * build info around just to know if the domain has a device model or = not. diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index d2d5af746b..50ac7b64ed 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1440,6 +1440,9 @@ _hidden int libxl__resolve_domid(libxl__gc *gc, const= char *name, * All libxl API functions are expected to have arranged for this * to be called before using any values within these structures. */ +_hidden int libxl__domain_config_setdefault(libxl__gc *gc, + libxl_domain_config *d_config, + uint32_t domid /* logging only= */); _hidden int libxl__domain_create_info_setdefault(libxl__gc *gc, libxl_domain_create_info *c_info); _hidden int libxl__domain_build_info_setdefault(libxl__gc *gc, --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel