if (def->os.bootloader == NULL &&
def->os.loader) {
- if ((bhyveDriverGetBhyveCaps(driver) & BHYVE_CAP_LPC_BOOTROM)) {
+ virArch arch = def->os.arch;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, "bootrom,%s", def->os.loader->path);
- if (def->os.loader->nvram && def->os.loader->nvram->path)
- virBufferAsprintf(&buf, ",%s", def->os.loader->nvram->path);
- virCommandAddArgList(cmd, "-l", virBufferContentAndReset(&buf), NULL);
- } else {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Installed bhyve binary does not support UEFI loader"));
- return NULL;
+ if (ARCH_IS_X86(arch)) {
+ if ((bhyveDriverGetBhyveCaps(driver) & BHYVE_CAP_LPC_BOOTROM)) {
+ virBufferAsprintf(&buf, "bootrom,%s", def->os.loader->path);
+ if (def->os.loader->nvram && def->os.loader->nvram->path)
+ virBufferAsprintf(&buf, ",%s", def->os.loader->nvram->path);
+
+ virCommandAddArgList(cmd, "-l", virBufferContentAndReset(&buf), NULL);
+ } else {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Installed bhyve binary does not support UEFI loader"));
+ return NULL;
+ }
+ } else if (ARCH_IS_ARM(arch)) {
+ virBufferAsprintf(&buf, "bootrom=%s", def->os.loader->path);
+ virCommandAddArgList(cmd, "-o", virBufferContentAndReset(&buf), NULL);
}
}
--- /dev/null
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ <loader readonly='yes'>/usr/local/share/u-boot/u-boot-bhyve-arm64/u-boot.bin</loader>
+ </os>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='vda' bus='virtio'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>