
Hi Andrea Bolognani:
On Thu, Dec 14, 2023 at 02:08:49PM +0800, xianglai li wrote:
+++ b/src/qemu/qemu_conf.c @@ -93,7 +93,8 @@ VIR_ONCE_GLOBAL_INIT(virQEMUConfig); "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:" \ "/usr/share/OVMF/OVMF_CODE.secboot.fd:/usr/share/OVMF/OVMF_VARS.fd:" \ "/usr/share/AAVMF/AAVMF_CODE.fd:/usr/share/AAVMF/AAVMF_VARS.fd:" \ - "/usr/share/AAVMF/AAVMF32_CODE.fd:/usr/share/AAVMF/AAVMF32_VARS.fd" + "/usr/share/AAVMF/AAVMF32_CODE.fd:/usr/share/AAVMF/AAVMF32_VARS.fd:" \ + "/usr/share/qemu/edk2-loongarch64-code.fd:/usr/share/qemu/edk2-loongarch64-vars.fd" #endif We definitely don't want this :)
The hard-coded CODE:VARS pairs are considered a legacy mechanism at this point, and we're no longer adding to them. If you try to pass a custom value at build time, a warning will be raised.
The way firmware is configured these days is through firmware descriptor files. See src/qemu/qemu_firmware* and tests/qemufirmware* for additional information, but the short version is that you want your edk2 package to include something like this:
# /usr/share/qemu/firmware/50-edk2-loongarch64.json { "interface-types": [ "uefi" ], "mapping": { "device": "flash", "mode" : "split", "executable": { "filename": "/usr/share/edk2/loongarch64/QEMU_CODE.fd", "format": "raw" }, "nvram-template": { "filename": "/usr/share/edk2/loongarch64/QEMU_VARS.fd", "format": "raw" } }, "targets": [ { "architecture": "loongarch64", "machines": [ "virt", "virt-*" ] } ] }
Once you have that, libvirt will automatically pick up the correct firmware when the VM is configured with
<os firmware='efi'>
Same as any other architecture, no custom entries needed.
Ok, I will remove the custom bios path and then try to add json in the qemu and edk2 installation packages. Thanks, Xianglai.