From nobody Tue May 7 01:58:27 2024 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; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1626972924; cv=none; d=zohomail.com; s=zohoarc; b=Xif/T5DHwWadgoblM1zJr71iI3j7iJWjZJ0QsgNnOd8qSLan28E4P2le4E+gHJ9lILsmpx9+S9XDgtXorIvSTwRmNpPUaWKTgbHeff9moPKohZCYMm2nSUHiTT438/sLRpltJqMcokUs3FlsUtWNMHyCc1BGMpTk7VIbUig+fOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626972924; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=+qtGke1okL2AN40/XGbkf4rzyvqwtoLs9lmPunYPJOw=; b=N2dPSU4lTFHG2pZLYgcpoUjVuf9gjlUzQz60G4BT3R2smi6R6bcMSABZtOKwZKeCyoLInvXZ/tANjuqeDSClY3pTIzCuGJYY1JnDzLvSX8syaixiUrpT8LI8D9SsXK66BO3LpKGAtqL+BsORWlXlFZGrjinvsUCVbixNJLASqEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1626972924184929.918353681895; Thu, 22 Jul 2021 09:55:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.159811.293887 (Exim 4.92) (envelope-from ) id 1m6byR-0008Ey-3z; Thu, 22 Jul 2021 16:55:03 +0000 Received: by outflank-mailman (output) from mailman id 159811.293887; Thu, 22 Jul 2021 16:55:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m6byQ-0008Er-W1; Thu, 22 Jul 2021 16:55:02 +0000 Received: by outflank-mailman (input) for mailman id 159811; Thu, 22 Jul 2021 16:55:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1m6byP-0008Ek-G8 for xen-devel@lists.xenproject.org; Thu, 22 Jul 2021 16:55:01 +0000 Received: from mail-qk1-x736.google.com (unknown [2607:f8b0:4864:20::736]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ecf09604-334f-4aa6-8f22-cabbf0ae051d; Thu, 22 Jul 2021 16:55:00 +0000 (UTC) Received: by mail-qk1-x736.google.com with SMTP id q190so6049371qkd.2 for ; Thu, 22 Jul 2021 09:55:00 -0700 (PDT) Received: from lagunitas.localdomain (96-95-26-25-static.hfc.comcastbusiness.net. [96.95.26.25]) by smtp.gmail.com with ESMTPSA id m17sm9516628qtu.34.2021.07.22.09.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 09:54:58 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ecf09604-334f-4aa6-8f22-cabbf0ae051d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+qtGke1okL2AN40/XGbkf4rzyvqwtoLs9lmPunYPJOw=; b=j6j5S1fb8jIJKJayLyHo0v1bQID9Ns883Mqrsb9L/aN5FM6NrtTxwkDP+Y//GHBYpI jgsbgFA/y8uSy0W7uWlLzQraRz+3SPZwVhkYdssE6Ie7jpwaqzH7g+MUESbQmjBRHP5S IglyEsSKFCgZrUvYfyuYeD7iEMH5+2tKxnrPS8joW+v8WQDcozO7EDb7KRd6ni9H9ydD c3HR7TsqNNQXT//qC4Y3cHokSNrOfEj5QzzWqyZ/5CYMbtfBJGc6cvy3C1rDNHErLktQ xJKQUZb0FQwPAslOAtBM1LGz1Qy16lW/jKmrRM/I+bUXK89HsbyOh3IyEXHql8PPzvGF VQwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+qtGke1okL2AN40/XGbkf4rzyvqwtoLs9lmPunYPJOw=; b=ClDTFIpceqInrw24zI2KsOpY/1rN0/AISnOF+lKeohtXHaneju1+Lf6M5IY8jYStRR 5/rL8xG7nXBk8434Nb6qu1vRHhixJX3fqEAmbCM60brRdAzO4w1Ov5XRYHd2RPq2Lei2 Uf4Qx2poal6r2D5lq8GmUyeY5wa7V6JXh1x3+XmyeArOcteQTmKo7pdC08OTI7UDrfOy zj0D/H78xnzm5drshvUoAZX8u5cGT/EqnOoAl5WxgP1Sj7PYHP6bi4GgTNgr+LFD0hdY hNj1IsUxAKo+MPgVU5z+g9zxIlFZg2/Yoln7VNh0CsbUAx+y4r5EwBdy1MaokGXHGGBq GJtg== X-Gm-Message-State: AOAM531a2WwszBb/PMdKypizKr8+3sfY+nspwqOFl1E0/XyWeGnnhcXI aola7ndfBVBHvF6L7HdXjp4UBpPhb+nOWk3G X-Google-Smtp-Source: ABdhPJxrnDIadPzesUIiXOaz71PDimOKJSD62kS4TL3XcEjfT4ri277Wg19Bxwl+c1rPhS8GziUdJQ== X-Received: by 2002:a37:641:: with SMTP id 62mr602952qkg.149.1626972899550; Thu, 22 Jul 2021 09:54:59 -0700 (PDT) From: Scott Davis X-Google-Original-From: Scott Davis To: xen-devel@lists.xenproject.org Cc: Scott Davis , Ian Jackson , Wei Liu , George Dunlap , Nick Rosbrook , Anthony PERARD , Juergen Gross , Jason Andryuk Subject: [XEN PATCH v2] tools/xl: Add stubdomain_cmdline option to xl.cfg Date: Thu, 22 Jul 2021 12:54:30 -0400 Message-Id: <93dd20b91ca75b35c5886e4051659e58bceb080d.1626970707.git.scott.davis@starlab.io> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1626972925482100001 Content-Type: text/plain; charset="utf-8" This adds an option to the xl domain configuration file syntax for specifyi= ng a kernel command line for device-model stubdomains. It is intended for use = with Linux-based stubdomains. Signed-off-by: Scott Davis Reviewed-by: Jason Andryuk Acked-by: Ian Jackson Reviewed-by: Julien Grall --- Changes in v2: - add #define LIBXL_HAVE_BUILDINFO_DEVICE_MODEL_STUBDOMAIN - correct wording in xl.cfg documentation from "Append" to "Set" --- docs/man/xl.cfg.5.pod.in | 4 ++++ tools/golang/xenlight/helpers.gen.go | 3 +++ tools/golang/xenlight/types.gen.go | 1 + tools/include/libxl.h | 12 ++++++++++++ tools/libs/light/libxl_dm.c | 1 + tools/libs/light/libxl_types.idl | 1 + tools/xl/xl_parse.c | 2 ++ 7 files changed, 24 insertions(+) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index 56370a37db..d6f96e5310 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -2742,6 +2742,10 @@ In case of B it is expected to= be MiniOS-based stubdomain image, in case of B it is expected to be Linux-based stubdomain kernel. =20 +=3Ditem B + +Set the device-model stubdomain kernel command line to B. + =3Ditem B =20 Override the path to the ramdisk image used as device-model stubdomain. diff --git a/tools/golang/xenlight/helpers.gen.go b/tools/golang/xenlight/h= elpers.gen.go index db82537b42..bfc1e7f312 100644 --- a/tools/golang/xenlight/helpers.gen.go +++ b/tools/golang/xenlight/helpers.gen.go @@ -1018,6 +1018,7 @@ return fmt.Errorf("converting field DeviceModelStubdo= main: %v", err) } x.StubdomainMemkb =3D uint64(xc.stubdomain_memkb) x.StubdomainKernel =3D C.GoString(xc.stubdomain_kernel) +x.StubdomainCmdline =3D C.GoString(xc.stubdomain_cmdline) x.StubdomainRamdisk =3D C.GoString(xc.stubdomain_ramdisk) x.DeviceModel =3D C.GoString(xc.device_model) x.DeviceModelSsidref =3D uint32(xc.device_model_ssidref) @@ -1344,6 +1345,8 @@ return fmt.Errorf("converting field DeviceModelStubdo= main: %v", err) xc.stubdomain_memkb =3D C.uint64_t(x.StubdomainMemkb) if x.StubdomainKernel !=3D "" { xc.stubdomain_kernel =3D C.CString(x.StubdomainKernel)} +if x.StubdomainCmdline !=3D "" { +xc.stubdomain_cmdline =3D C.CString(x.StubdomainCmdline)} if x.StubdomainRamdisk !=3D "" { xc.stubdomain_ramdisk =3D C.CString(x.StubdomainRamdisk)} if x.DeviceModel !=3D "" { diff --git a/tools/golang/xenlight/types.gen.go b/tools/golang/xenlight/typ= es.gen.go index a214dd9df6..09a3bb67e2 100644 --- a/tools/golang/xenlight/types.gen.go +++ b/tools/golang/xenlight/types.gen.go @@ -483,6 +483,7 @@ DeviceModelVersion DeviceModelVersion DeviceModelStubdomain Defbool StubdomainMemkb uint64 StubdomainKernel string +StubdomainCmdline string StubdomainRamdisk string DeviceModel string DeviceModelSsidref uint32 diff --git a/tools/include/libxl.h b/tools/include/libxl.h index ae7fe27c1f..b9ba16d698 100644 --- a/tools/include/libxl.h +++ b/tools/include/libxl.h @@ -1030,6 +1030,18 @@ typedef struct libxl__ctx libxl_ctx; */ #define LIBXL_HAVE_BUILDINFO_KERNEL 1 =20 +/* + * LIBXL_HAVE_BUILDINFO_DEVICE_MODEL_STUBDOMAIN + * + * If this is defined, then the libxl_domain_build_info structure will con= tain + * the following fields that specify options for device model stubdomains: + * - stubdomain_memkb: integer indicating stubdomain RAM size + * - stubdomain_kernel: string indicating stubdomain kernel image locati= on + * - stubdomain_cmdline: string of parameters to pass to the stubdomain k= ernel + * - stubdomain_ramdisk: string indicating stubdomain ramdisk location + */ +#define LIBXL_HAVE_BUILDINFO_DEVICE_MODEL_STUBDOMAIN 1 + /* * LIBXL_HAVE_DEVICE_CHANNEL * diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c index dbd3c7f278..2d54596834 100644 --- a/tools/libs/light/libxl_dm.c +++ b/tools/libs/light/libxl_dm.c @@ -2373,6 +2373,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stu= b_dm_spawn_state *sdss) } =20 stubdom_state->pv_kernel.path =3D guest_config->b_info.stubdomain_kern= el; + stubdom_state->pv_cmdline =3D guest_config->b_info.stubdomain_cmdline; stubdom_state->pv_ramdisk.path =3D guest_config->b_info.stubdomain_ram= disk; =20 /* fixme: this function can leak the stubdom if it fails */ diff --git a/tools/libs/light/libxl_types.idl b/tools/libs/light/libxl_type= s.idl index f45adddab0..e782e15cf2 100644 --- a/tools/libs/light/libxl_types.idl +++ b/tools/libs/light/libxl_types.idl @@ -523,6 +523,7 @@ libxl_domain_build_info =3D Struct("domain_build_info",[ ("device_model_stubdomain", libxl_defbool), ("stubdomain_memkb", MemKB), ("stubdomain_kernel", string), + ("stubdomain_cmdline", string), ("stubdomain_ramdisk", string), # if you set device_model you must set device_model_version too ("device_model", string), diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 9fb0791429..17dddb4cd5 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -2533,6 +2533,8 @@ skip_usbdev: =20 xlu_cfg_replace_string (config, "stubdomain_kernel", &b_info->stubdomain_kernel, 0); + xlu_cfg_replace_string (config, "stubdomain_cmdline", + &b_info->stubdomain_cmdline, 0); xlu_cfg_replace_string (config, "stubdomain_ramdisk", &b_info->stubdomain_ramdisk, 0); if (!xlu_cfg_get_long (config, "stubdomain_memory", &l, 0)) --=20 2.25.1