On 1/28/26 18:11, Roman Bogorodskiy wrote:
> 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 <[email protected]>
> ---
> 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(-)
You'll need to squash the following in:
diff --git i/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml
w/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml
index d6c9caa225..b2d88789c8 100644
--- i/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml
+++ w/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml
@@ -6,7 +6,7 @@
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64'>hvm</type>
- <loader readonly='yes'
type='pflash'>/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin</loader>
+ <loader readonly='yes' type='pflash'>fakeubootpath/u-boot.bin</loader>
<boot dev='hd'/>
</os>
<clock offset='localtime'/>
diff --git i/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-console.xml
w/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-console.xml
index d694ecfb8d..741570a5b5 100644
--- i/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-console.xml
+++ w/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-console.xml
@@ -6,7 +6,7 @@
<vcpu placement='static'>1</vcpu>
<os>
<type arch='aarch64'>hvm</type>
- <loader readonly='yes'
type='pflash'>/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin</loader>
+ <loader readonly='yes' type='pflash'>fakeubootpath/u-boot.bin</loader>
<boot dev='hd'/>
</os>
<clock offset='localtime'/>
diff --git i/tests/bhyvexml2xmltest.c w/tests/bhyvexml2xmltest.c
index 50bf82bd52..1e32f163d9 100644
--- i/tests/bhyvexml2xmltest.c
+++ w/tests/bhyvexml2xmltest.c
@@ -56,6 +56,7 @@ testCompareXMLToXMLHelper(const void *data)
static int
mymain(void)
{
+ g_autofree char *fakeubootpath = g_strdup("fakeubootpath/u-boot.bin");
int ret = 0;
if ((driver.caps = virBhyveCapsBuild()) == NULL)
@@ -67,6 +68,8 @@ mymain(void)
if (!(driver.config = virBhyveDriverConfigNew()))
return EXIT_FAILURE;
+ driver.config->ubootPath = fakeubootpath;
+
# define DO_TEST_FULL(name, flags) \
do { \
const struct testInfo info = {name, (flags)}; \
Reviewed-by: Michal Privoznik <[email protected]>
Michal