Currently, bhyve does not support UTC clock offset on ARM64.
However, when <clock offset= > is not specified in the domain XML,
UTC offset is used by default. That results in an incorrect
configuration for the bhyve ARM64 guests by default.
Workaround is to extend bhyveDomainDefPostParse() to fall back
to the LOCALTIME clock offset when UTC clock offset is not
supported by bhyve.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
VIR_DOMAIN_CONTROLLER_MODEL_ISA_DEFAULT);
}
+ /* When not specified in the domain XML, clock.offset defaults to UTC which is
+ * not supported by bhyve on ARM64. So force it to LOCALTIME. */
+ if ((def->clock.offset == VIR_DOMAIN_CLOCK_OFFSET_UTC) &&
+ !(bhyveDriverGetBhyveCaps(driver) & BHYVE_CAP_RTC_UTC))
+ def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME;
+
return 0;
}
bhyve \
-c 1 \
-m 214 \
--u \
-s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
-s 2:0,virtio-blk,/tmp/freebsd.img \
bhyve \
-c 1 \
-m 214 \
--u \
-s 0:0,hostbridge \
-o bootrom=/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
bhyve \
-c 1 \
-m 214 \
--u \
-s 0:0,hostbridge \
-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
-s 2:0,virtio-blk,/tmp/freebsd.img \
/* arm64 tests */
virTestSetHostArch(VIR_ARCH_AARCH64);
driver.caps = virBhyveCapsBuild();
+ /* bhyve does not support UTC clock on ARM */
+ driver.bhyvecaps ^= BHYVE_CAP_RTC_UTC;
DO_TEST("base");
DO_TEST("console");
<type arch='aarch64'>hvm</type>
<boot dev='hd'/>
</os>
- <clock offset='utc'/>
+ <clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<loader readonly='yes' type='rom'>/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin</loader>
<boot dev='hd'/>
</os>
- <clock offset='utc'/>
+ <clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<type arch='aarch64'>hvm</type>
<boot dev='hd'/>
</os>
- <clock offset='utc'/>
+ <clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
# define DO_TEST_FAILURE(name) \
DO_TEST_FULL(name, FLAG_EXPECT_FAILURE)
- driver.bhyvecaps = BHYVE_CAP_AHCI32SLOT;
+ driver.bhyvecaps = BHYVE_CAP_AHCI32SLOT | BHYVE_CAP_RTC_UTC;
DO_TEST_DIFFERENT("acpiapic");
DO_TEST_DIFFERENT("base");
virTestSetHostArch(VIR_ARCH_AARCH64);
driver.caps = virBhyveCapsBuild();
+ /* bhyve does not support UTC clock on ARM */
+ driver.bhyvecaps ^= BHYVE_CAP_RTC_UTC;
DO_TEST_DIFFERENT("base");
DO_TEST_DIFFERENT("console");