From nobody Mon Feb 2 06:00:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1769620446; cv=none; d=zohomail.com; s=zohoarc; b=h7xeqcHSo5A9e0AwvM9c9pbxVHN8ALz0oLbw4ebg+1OstBQCcnxrv3yX4pOScseLKe8IPpOCaKAjKRwSZxbBxgtpLdgHPNY6Am+IL9gkcZZgItjjXGdlMnhFwVhYqH61bEFhrqlfydmqkvsHDqw4cm/IJ7tbAo7M9hM8/fRE1hA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769620446; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=AoyNMPrhM0F68pf7EQ1XLVySw5XX8vhMVBrbLgkM5vs=; b=YV4sxDUhbsaHZ09opJ5uneFI6stqnyZ8X+ngJQ+aYDb7XBFxXvQqZGMN8vwuXu/a+zg2DCVl7x+PDZmf0YtVCvc+NYn6WbOvjlA7eoeGw/id0JOyzP/UbTtsdnSoDuxQjYobSQyidfAzD50aQmODboWMbgIhIi29qUkWHomSOSs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 176962044647568.51705699675995; Wed, 28 Jan 2026 09:14:06 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2885541AC5; Wed, 28 Jan 2026 12:14:06 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 55DAB41C8E; Wed, 28 Jan 2026 12:12:14 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id D8EEE418A8; Wed, 28 Jan 2026 12:12:08 -0500 (EST) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 4DC164189D for ; Wed, 28 Jan 2026 12:12:08 -0500 (EST) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-b79f8f7ea43so10819166b.2 for ; Wed, 28 Jan 2026 09:12:08 -0800 (PST) Received: from tulp.my.domain (2001-1c02-1a15-3000-c218-03ff-feb5-6cc4.cable.dynamic.v6.ziggo.nl. [2001:1c02:1a15:3000:c218:3ff:feb5:6cc4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1baa42sm150216266b.46.2026.01.28.09.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 09:12:04 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769620326; x=1770225126; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AoyNMPrhM0F68pf7EQ1XLVySw5XX8vhMVBrbLgkM5vs=; b=DtOC0O9iEiRc1z65g9i46bqa9PSBUAPUFDYqr3mhRTnfVUsOK5RHANA42M6Foc2QQl +trXrRQPWQrtj6SZZ/ZLX7nCnutTQZA9bDrfgN514mrIDno3vQMus84ZUsu0Jg4DibtD pHSWD1YdmfeSonKeS/nV5E3S2UDtCLGLUWv0OU0uY0IrgJdG6th59ZTsa6kivgZgaQvK mOgZBaLUL0Mf5QKVcKbC+WK6Zy360p6JiyNueCC6iTHnPGNMMXEaRtAPXew5iQQvZqfL 43RtJean9vdT9lNo0f/O49yQos+GJ35/v8Ejkeyoz0WnSg1NlHTOrieyLTf2qX2WpJfB qJyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769620326; x=1770225126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AoyNMPrhM0F68pf7EQ1XLVySw5XX8vhMVBrbLgkM5vs=; b=eKBq8ewSX/PQQhS1irctCIkmUgvC26O27JDUdkvOfGb3gcRbxMYsRNNWz7y1m8AJh2 ovWHs0RYwnOPkzUep+0emq1/tRoDBrap1kWjA+c06X6DR+lNkMNtTMObFKdgDWZhcjc5 QXXO+Rnd3MsJdM587a0wKhGH2O16r50pzz2KqffOX67HwdYG38yLQER+xhoIiIScEPfD OZOh1h/Axpoy9lZnZ6I6XZLQpIf+WmIIUcdCE+MN4r3u5w4+7P8zAcOZzR5sJjzpf5u7 MnalGk9W/DKBECwTU5PAU9Z1TMAiti3qU6xTGxnkGrVZmyONWjNryioxkxWlEyraHbuY B59A== X-Gm-Message-State: AOJu0Ywl9jSWzaGiZ4L2w26MhZDIYJjHfyKuUv3qPYfzd2LBWYlZkC4M qqlCP7Lu/e97iPmAZUICn20/CtwZ5chlGsEHoLlwfefPEYqokcvY/Y3AeaScg3Xn X-Gm-Gg: AZuq6aJSHSr7b2dpglS+moKm9PJxPi+0BCgaN94xPfYcZ8hUe3WcrKrwIRkwG7fcZzs dUZ9d0fCS5a5NOBWhBVPeNzR6oueGsgSmjiQIl95ZBhfH3PXeScCSDSjw/XMboY2xi2SJ43YiP8 FRhjCcNeTc9ZHnFyhPqftFN4CKuU/UzMh0GlS/HBv8S1L1gVmJNCA1vX/WZ7CjIyZxE+7bS8TUo Pqjk3acBdD3V9LgPITvsownVEJ/JdfPGOY7y/QSN9zfSNGE2mlfPmoiRsbrwnlZ62NaSJqGCy8K eniDfU7/ThYnZSFWpsJX4EPaTLeeIryIncCpq/3kbhsdfvXaeY/uKzBPBxNjs2q6HEdEiciDTxS oNMWaAnFHPyXV+tvIEX1vj9SrnTFfF6k6jgLpAvhE3xyX1+V0a82Ntpm1pzxD8aPjkDlaBIYMKE WcC77DfrfNrOlZwqyMgR9OFEfrzf/rcPIOVcDLOtlK45+/7yxGjpYEXBVtoSlL9Z5bnabcFaVbc PIo1xelkzcil/2+oRKW0AwR X-Received: by 2002:a17:907:1c95:b0:b87:6f58:a845 with SMTP id a640c23a62f3a-b8dab330a3amr447035966b.36.1769620325840; Wed, 28 Jan 2026 09:12:05 -0800 (PST) From: Roman Bogorodskiy To: devel@lists.libvirt.org Subject: [PATCH v2 1/2] bhyve: improve loader handling on arm64 Date: Wed, 28 Jan 2026 18:11:41 +0100 Message-ID: <20260128171142.31492-2-bogorodskiy@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260128171142.31492-1-bogorodskiy@gmail.com> References: <20260128171142.31492-1-bogorodskiy@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: UZSXZAYE3IXS4WQLT6BN2BPFLQM6Z5U3 X-Message-ID-Hash: UZSXZAYE3IXS4WQLT6BN2BPFLQM6Z5U3 X-MailFrom: bogorodskiy@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Roman Bogorodskiy X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1769620447969158500 Content-Type: text/plain; charset="utf-8" Bhyve on arm64 does not have the bhyveload(8) tool. That means that it cannot be used as a default if the loader is not configured for the domain. To prevent users from getting unusable configurations, handle loader configuration on arm64 like that: - if loader is specified in the domain XML, just use it - if not specified, try to check whether the default uboot loader is available on the system. In case it is, set is as the loader, otherwise fail with the error. Additionally, the loader could be configured in bhyve.conf. By default, it uses the loader installed by the sysutils/u-boot-bhyve-arm64 port or a corresponding package. Signed-off-by: Roman Bogorodskiy --- src/bhyve/bhyve.conf | 5 ++++ src/bhyve/bhyve_conf.c | 8 +++++++ src/bhyve/bhyve_domain.c | 23 +++++++++++++++++++ src/bhyve/bhyve_utils.h | 2 ++ .../aarch64/bhyvexml2argv-base.args | 1 + .../aarch64/bhyvexml2argv-base.ldargs | 8 +------ .../aarch64/bhyvexml2argv-console.args | 1 + .../aarch64/bhyvexml2argv-console.ldargs | 8 +------ tests/bhyvexml2argvmock.c | 20 +++++++++++++++- tests/bhyvexml2argvtest.c | 2 ++ .../aarch64/bhyvexml2xmlout-base.xml | 1 + .../aarch64/bhyvexml2xmlout-console.xml | 1 + tests/bhyvexml2xmltest.c | 4 ++++ 13 files changed, 69 insertions(+), 15 deletions(-) diff --git a/src/bhyve/bhyve.conf b/src/bhyve/bhyve.conf index dc8d3d8fd8..a845937d87 100644 --- a/src/bhyve/bhyve.conf +++ b/src/bhyve/bhyve.conf @@ -6,6 +6,11 @@ # to the directory that sysutils/bhyve-firmware installs files into. #firmware_dir =3D "/usr/local/share/uefi-firmware" =20 +# Path to the U-Boot loader for the arm64 guests. +# By default it's pointing to the loader installed +# by the sysutils/u-boot-bhyve-arm64 port +#uboot_path =3D "/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin" + # Set timeout for the bhyveload(8) command. This might be necessary # because in case of errors bhyveload(8) drops to an interactive # loader and hangs indefinitely. These timeout values are passed diff --git a/src/bhyve/bhyve_conf.c b/src/bhyve/bhyve_conf.c index 182e00ee1d..f9a657f402 100644 --- a/src/bhyve/bhyve_conf.c +++ b/src/bhyve/bhyve_conf.c @@ -61,6 +61,8 @@ virBhyveDriverConfigNew(void) cfg->libDir =3D g_strdup_printf("%s/lib/libvirt/bhyve", LOCALSTATEDIR); cfg->nvramDir =3D g_strdup_printf("%s/nvram", cfg->libDir); =20 + cfg->ubootPath =3D g_strdup(DATADIR "/u-boot/u-boot-bhyve-arm64/u-boot= .bin"); + cfg->bhyveloadTimeout =3D 300; cfg->bhyveloadTimeoutKill =3D 15; =20 @@ -85,6 +87,10 @@ virBhyveLoadDriverConfig(struct _virBhyveDriverConfig *c= fg, &cfg->firmwareDir) < 0) return -1; =20 + if (virConfGetValueString(conf, "uboot_path", + &cfg->ubootPath) < 0) + return -1; + if (virConfGetValueInt(conf, "bhyveload_timeout", &cfg->bhyveloadTimeout) < 0) return -1; @@ -111,6 +117,8 @@ virBhyveDriverConfigDispose(void *obj) g_free(cfg->firmwareDir); g_free(cfg->libDir); g_free(cfg->nvramDir); + + g_free(cfg->ubootPath); } =20 void diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index df0a008ecd..8fc9733756 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -27,6 +27,7 @@ #include "bhyve_domain.h" #include "bhyve_capabilities.h" #include "viralloc.h" +#include "virfile.h" #include "virlog.h" #include "virutil.h" =20 @@ -112,6 +113,28 @@ bhyveDomainDefPostParse(virDomainDef *def, !(bhyveDriverGetBhyveCaps(driver) & BHYVE_CAP_RTC_UTC)) def->clock.offset =3D VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME; =20 + /* bhyve/arm64 does not provide the bhyveload(8) tool, + * so if the loader is not specified and we cannot fall back to the + * default one, then this results in an unusable configuration. */ + if (ARCH_IS_ARM(def->os.arch)) { + if (def->os.loader =3D=3D NULL) { + g_autoptr(virBhyveDriverConfig) cfg =3D virBhyveDriverGetConfi= g(driver); + char *uboot_path =3D cfg->ubootPath; + + if (virFileExists(uboot_path)) { + def->os.loader =3D virDomainLoaderDefNew(); + def->os.loader->path =3D g_strdup(uboot_path); + def->os.loader->readonly =3D true; + def->os.loader->type =3D VIR_DOMAIN_LOADER_TYPE_PFLASH; + } else { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("loader is not specified and the default = loader (%1$s) not found"), + uboot_path); + return -1; + } + } + } + return 0; } =20 diff --git a/src/bhyve/bhyve_utils.h b/src/bhyve/bhyve_utils.h index 8ed1fa5509..19369047fe 100644 --- a/src/bhyve/bhyve_utils.h +++ b/src/bhyve/bhyve_utils.h @@ -42,6 +42,8 @@ struct _virBhyveDriverConfig { char *libDir; char *nvramDir; =20 + char *ubootPath; + int bhyveloadTimeout; int bhyveloadTimeoutKill; }; diff --git a/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.args b/test= s/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.args index aef3ebd017..37292aa3fe 100644 --- a/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.args +++ b/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.args @@ -2,6 +2,7 @@ bhyve \ -c 1 \ -m 214 \ -s 0:0,hostbridge \ +-o bootrom=3Dfakeubootpath/u-boot.bin \ -s 3:0,virtio-net,faketapdev,mac=3D52:54:00:b9:94:02 \ -s 2:0,virtio-blk,/tmp/freebsd.img \ bhyve diff --git a/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.ldargs b/te= sts/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.ldargs index 264ae48441..421376db9e 100644 --- a/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.ldargs +++ b/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.ldargs @@ -1,7 +1 @@ -timeout \ ---foreground \ ---verbose \ --k 20s 300s bhyveload \ --m 214 \ --d /tmp/freebsd.img \ -bhyve +dummy diff --git a/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.args b/t= ests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.args index 4a031afb71..afd5f5d7b2 100644 --- a/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.args +++ b/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.args @@ -2,6 +2,7 @@ bhyve \ -c 1 \ -m 214 \ -s 0:0,hostbridge \ +-o bootrom=3Dfakeubootpath/u-boot.bin \ -s 3:0,virtio-net,faketapdev,mac=3D52:54:00:b9:94:02 \ -s 2:0,virtio-blk,/tmp/freebsd.img \ -o console=3D/dev/nmdm0A \ diff --git a/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.ldargs b= /tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.ldargs index 264ae48441..421376db9e 100644 --- a/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.ldargs +++ b/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.ldargs @@ -1,7 +1 @@ -timeout \ ---foreground \ ---verbose \ --k 20s 300s bhyveload \ --m 214 \ --d /tmp/freebsd.img \ -bhyve +dummy diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c index fe76564d51..191d6bdaf5 100644 --- a/tests/bhyvexml2argvmock.c +++ b/tests/bhyvexml2argvmock.c @@ -2,7 +2,9 @@ =20 #include =20 +#include "configmake.h" #include "viralloc.h" +#include "virfile.h" #include "virstring.h" #include "virnetdev.h" #include "virnetdevtap.h" @@ -12,11 +14,16 @@ #define VIR_FROM_THIS VIR_FROM_BHYVE =20 static DIR * (*real_opendir)(const char *name); +static bool (*real_virFileExists)(const char *path); =20 static void init_syms(void) { - VIR_MOCK_REAL_INIT(opendir); + if (!real_opendir) + VIR_MOCK_REAL_INIT(opendir); + + if (!real_virFileExists) + VIR_MOCK_REAL_INIT(virFileExists); } =20 #define FAKEFIRMWAREDIR abs_srcdir "/bhyvefirmwaredata/three_firmwares" @@ -89,3 +96,14 @@ int bind(int sockfd G_GNUC_UNUSED, { return 0; } + +bool +virFileExists(const char *path) +{ + init_syms(); + + if (STREQ(path, "fakeubootpath/u-boot.bin")) + return true; + + return real_virFileExists(path); +} diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index c7c18c3690..42c14b6ab3 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -151,6 +151,7 @@ mymain(void) g_autofree char *fakefirmwaredir =3D g_strdup("fakefirmwaredir"); g_autofree char *fakenvramdir =3D g_strdup("fakenvramdir"); g_autofree char *fakefirmwareemptydir =3D g_strdup("fakefirmwareemptyd= ir"); + g_autofree char *fakeubootpath =3D g_strdup("fakeubootpath/u-boot.bin"= ); =20 if ((driver.caps =3D virBhyveCapsBuild()) =3D=3D NULL) return EXIT_FAILURE; @@ -166,6 +167,7 @@ mymain(void) =20 driver.config->firmwareDir =3D fakefirmwaredir; driver.config->nvramDir =3D fakenvramdir; + driver.config->ubootPath =3D fakeubootpath; driver.config->bhyveloadTimeout =3D 0; driver.config->bhyveloadTimeoutKill =3D 0; =20 diff --git a/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml b/t= ests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml index ee72370047..d6c9caa225 100644 --- a/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml +++ b/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml @@ -6,6 +6,7 @@ 1 hvm + /usr/local/share/u-boot/u-boo= t-bhyve-arm64/u-boot.bin diff --git a/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-console.xml = b/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-console.xml index d43ce8fd6f..d694ecfb8d 100644 --- a/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-console.xml +++ b/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-console.xml @@ -6,6 +6,7 @@ 1 hvm + /usr/local/share/u-boot/u-boo= t-bhyve-arm64/u-boot.bin diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c index 5df1f2b6ba..50bf82bd52 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -5,6 +5,7 @@ #ifdef WITH_BHYVE =20 # include "bhyve/bhyve_capabilities.h" +# include "bhyve/bhyve_conf.h" # include "bhyve/bhyve_domain.h" # include "bhyve/bhyve_utils.h" =20 @@ -63,6 +64,9 @@ mymain(void) if ((driver.xmlopt =3D virBhyveDriverCreateXMLConf(&driver)) =3D=3D NU= LL) return EXIT_FAILURE; =20 + if (!(driver.config =3D virBhyveDriverConfigNew())) + return EXIT_FAILURE; + # define DO_TEST_FULL(name, flags) \ do { \ const struct testInfo info =3D {name, (flags)}; \ --=20 2.52.0 From nobody Mon Feb 2 06:00:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1769620490; cv=none; d=zohomail.com; s=zohoarc; b=j0H5ehTDDR2QLxlyoARKnctG7u6u64ro94+rjtt20R3uG9oYuErDX617BKJiyDrxYZBb4dmxGmtqj/3oiJEOkaujXVfWLNZe1qqhdtI0AnFC7Dw/kEsefQ+3lgh056lZ5rM76P9qJNGf83tg/XlsqsQhFmBnULSvDssEvqj/0SI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769620490; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=SOAS8Fl8l73K6SW9BQuvM0bwvt8GyxyAJHlKJO4/U8U=; b=dOILa9j0C5L5Y51iMhUcI5BBrsHgAjp2Hzq6dLeXMayovdMXGT94ECOm299Aus1XMM13l05qsOYELy6A7YDgq71HWgK1oLsY5MWNZRlhnvnU6xaH9bsZQz/funSyR8l6syzbSZ40CT8OTZi1SvgNC3BjrITH6CN6AUpWf3X/29s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769620490968150.2883630863189; Wed, 28 Jan 2026 09:14:50 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id B8254418EE; Wed, 28 Jan 2026 12:14:49 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 4A49843E0B; Wed, 28 Jan 2026 12:12:15 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 5BEE2418A8; Wed, 28 Jan 2026 12:12:09 -0500 (EST) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id E500F4189D for ; Wed, 28 Jan 2026 12:12:08 -0500 (EST) Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-65812261842so1820308a12.1 for ; Wed, 28 Jan 2026 09:12:08 -0800 (PST) Received: from tulp.my.domain (2001-1c02-1a15-3000-c218-03ff-feb5-6cc4.cable.dynamic.v6.ziggo.nl. [2001:1c02:1a15:3000:c218:3ff:feb5:6cc4]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbf1baa42sm150216266b.46.2026.01.28.09.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 09:12:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769620327; x=1770225127; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SOAS8Fl8l73K6SW9BQuvM0bwvt8GyxyAJHlKJO4/U8U=; b=JYth15tMxaOEPAaiRkB0psb6GWGExcYcrDc5ErQGBYfi/sZtaaML0OPJ9Sxtfg1mXO THs1WRwIcFPbJuA5l7CsuFglI+kfNXohgLWPb9XSb40aVZXbIjgOPBW6jYQ+f50TmBpi gwWw7Ar8FLRBBMZEuBVznhMH0OaVgBVqMf6mZ4avekUFvRBQmI11PLNi6V7KWuj7LNO8 NN1T5E623iqrkfXrWgAoluG9Rod1SNQsM1KVjRBw+5tW0GRMLNFjRYlxJF0jpNHxXFP8 NmLnFNMeO9LCC2DcoGSHQZSUd44tA+0otPoWFpgDvUe6Oj9N+wCtCpigEWUmhurMTPuC V7bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769620327; x=1770225127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SOAS8Fl8l73K6SW9BQuvM0bwvt8GyxyAJHlKJO4/U8U=; b=fjGH+wtpmocRx6w94sA9CVaJCmkvOz/m+eDFp/lx3SdfFKteH8HqfbeVdQI9Ba8XFy FapRGYJNpSOx6m+dmT9p6BIbFLC05uW+xnvKBr70i7LOc1/7Te8h+zbvkfXDwLbaMnic QV6/uB+iNhlyQDJM7Y18rKo0TN13FkcXA37/D+g2HvrbRRLNZHZ6w6hid4GitnWUSTzk xETyFZ9W4xRyEaOcXR8nPpCVvOeIQlT6fFxFceFRCU4dn/FGaUZBDaWCpSfkV5XisxpG CXw8/hxSfYMpt29HewrsXs/oTGDyiBiKPUTamakFCnIzQnOp1Oi9HZ5vUcCaZnKJzTW5 Fvlw== X-Gm-Message-State: AOJu0YxbWpe4Zkzlwp7CR9AmYzD3h5B2GXeLTjz3T9/xxnaiBduBe2ih hx86NUvtWnaAtsUFvxi6EjaYAXOv7c15jW2Dn3AcJhHKobm6skkr9Byzp6dWdxAu X-Gm-Gg: AZuq6aIj48652ur0ElPID2rrBiGshuC1MBwoTVrk+BNEbLlfKX5oFlikQUekbo/nLjY JRUmTDITYJP3Nd1JXQ00c5k/kLjt7y9xks5ZApifcTuzNqyH/9k36R2nH/J7F77TVRgzNokosbj ZzPOBX7lrBOhSV2OZr4OerQi9tbPSuk19PMwgaa/IyTSEANOWU8wmsI7RLNYxS2o9dzc9Ym0sh0 YqPBz4ls/1jjPqqJBXnT0TWk3tHWA3FH32pXkfc+TsqUpEv6yZecl8U4zSPgUctCwnhc0w8mLmF 7hO/0wPXGQg3GMdjkxeewCO8WwG73kwZkeSN85QRz55BsMFKeKLLYXed6CD/LRq2si7unBme6nU M73HNLVvqH4owTWiMeMTOiHmZuRx3nGb6c7jdcBz5laQK/tRlgtIPqhxbtGKYiR9huzfzBgATze WilTMvO6TDs/PYxR6R66iYZqdfewZmDksRzAChZg8D/vB1Ov9+mSNLBOol/+UX2CcP7ipV1Occ9 JNpuc+9Z3c5sLahY/JKk1uP X-Received: by 2002:a17:907:7293:b0:b88:51cb:fd65 with SMTP id a640c23a62f3a-b8ddf804f8emr10862666b.3.1769620327066; Wed, 28 Jan 2026 09:12:07 -0800 (PST) From: Roman Bogorodskiy To: devel@lists.libvirt.org Subject: [PATCH v2 2/2] bhyve: conf: do not hardcode datadir in bhyve.conf Date: Wed, 28 Jan 2026 18:11:42 +0100 Message-ID: <20260128171142.31492-3-bogorodskiy@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260128171142.31492-1-bogorodskiy@gmail.com> References: <20260128171142.31492-1-bogorodskiy@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: RQWNAB2GMITKGL37LBGOKEKWRTUZPGQ3 X-Message-ID-Hash: RQWNAB2GMITKGL37LBGOKEKWRTUZPGQ3 X-MailFrom: bogorodskiy@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Roman Bogorodskiy X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1769620493350154100 Content-Type: text/plain; charset="utf-8" Do not hardcode "/usr/local/share" directory in the configuration file for the firmware and uboot paths. Use meson's configure_file()/configuration_data() to substitute it with the "datadir" value. Signed-off-by: Roman Bogorodskiy --- src/bhyve/{bhyve.conf =3D> bhyve.conf.in} | 4 ++-- src/bhyve/meson.build | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) rename src/bhyve/{bhyve.conf =3D> bhyve.conf.in} (87%) diff --git a/src/bhyve/bhyve.conf b/src/bhyve/bhyve.conf.in similarity index 87% rename from src/bhyve/bhyve.conf rename to src/bhyve/bhyve.conf.in index a845937d87..5ed6a14db5 100644 --- a/src/bhyve/bhyve.conf +++ b/src/bhyve/bhyve.conf.in @@ -4,12 +4,12 @@ =20 # Path to a directory with firmware files. By default it's pointing # to the directory that sysutils/bhyve-firmware installs files into. -#firmware_dir =3D "/usr/local/share/uefi-firmware" +#firmware_dir =3D "@DATADIR@/uefi-firmware" =20 # Path to the U-Boot loader for the arm64 guests. # By default it's pointing to the loader installed # by the sysutils/u-boot-bhyve-arm64 port -#uboot_path =3D "/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin" +#uboot_path =3D "@DATADIR@/u-boot/u-boot-bhyve-arm64/u-boot.bin" =20 # Set timeout for the bhyveload(8) command. This might be necessary # because in case of errors bhyveload(8) drops to an interactive diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 11920d9c3e..564b7e5db2 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -50,12 +50,21 @@ if conf.has('WITH_BHYVE') ], } =20 - virt_conf_files +=3D files('bhyve.conf') + bhyve_conf_data =3D configuration_data({ + 'DATADIR': datadir, + }) + bhyve_conf =3D configure_file( + input: 'bhyve.conf.in', + output: 'bhyve.conf', + configuration: bhyve_conf_data, + ) + + virt_conf_files +=3D bhyve_conf virt_aug_files +=3D files('libvirtd_bhyve.aug') virt_test_aug_files +=3D { 'name': 'test_libvirtd_bhyve.aug', 'aug': files('test_libvirtd_bhyve.aug.in'), - 'conf': files('bhyve.conf'), + 'conf': bhyve_conf, 'test_name': 'libvirtd_bhyve', 'test_srcdir': meson.current_source_dir(), 'test_builddir': meson.current_build_dir(), --=20 2.52.0