On 1/25/26 07:54, 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.
>
> Signed-off-by: Roman Bogorodskiy <[email protected]>
> ---
> src/bhyve/bhyve_domain.c | 22 +++++++++++++++++++
> .../aarch64/bhyvexml2argv-base.args | 1 +
> .../aarch64/bhyvexml2argv-base.ldargs | 8 +------
> .../aarch64/bhyvexml2argv-console.args | 1 +
> .../aarch64/bhyvexml2argv-console.ldargs | 8 +------
> tests/bhyvexml2argvmock.c | 20 ++++++++++++++++-
> .../aarch64/bhyvexml2xmlout-base.xml | 1 +
> .../aarch64/bhyvexml2xmlout-console.xml | 1 +
> 8 files changed, 47 insertions(+), 15 deletions(-)
You'll need to regenerate tests too. Squash this in:
diff --git i/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.args
w/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.args
index 1079beee52..d01f62ff5c 100644
--- i/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.args
+++ w/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-base.args
@@ -2,7 +2,7 @@ bhyve \
-c 1 \
-m 214 \
-s 0:0,hostbridge \
--o bootrom=/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin \
+-o bootrom=/usr/share/u-boot/u-boot-bhyve-arm64/u-boot.bin \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
-s 2:0,virtio-blk,/tmp/freebsd.img \
bhyve
diff --git i/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.args
w/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.args
index ea2cc15713..069ecf3425 100644
--- i/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.args
+++ w/tests/bhyvexml2argvdata/aarch64/bhyvexml2argv-console.args
@@ -2,7 +2,7 @@ bhyve \
-c 1 \
-m 214 \
-s 0:0,hostbridge \
--o bootrom=/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin \
+-o bootrom=/usr/share/u-boot/u-boot-bhyve-arm64/u-boot.bin \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
-s 2:0,virtio-blk,/tmp/freebsd.img \
-o console=/dev/nmdm0A \
diff --git i/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml
w/tests/bhyvexml2xmloutdata/aarch64/bhyvexml2xmlout-base.xml
index d6c9caa225..eb28be7dfd 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'>/usr/share/u-boot/u-boot-bhyve-arm64/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..dc358cbaab 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'>/usr/share/u-boot/u-boot-bhyve-arm64/u-boot.bin</loader>
<boot dev='hd'/>
</os>
<clock offset='localtime'/>
Reviewed-by: Michal Privoznik <[email protected]>
Michal