]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_firmware: Don't skip autoselection for ROM
authorAndrea Bolognani <abologna@redhat.com>
Mon, 17 Nov 2025 14:47:30 +0000 (15:47 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 8 Jan 2026 23:26:16 +0000 (00:26 +0100)
It's possible to have firmware descriptors for builds intended to
be loaded as ROM, as is the case for those loaded as pflash.
There is no reason to skip firmware autoselection in those cases,
and doing so prevents useful information from being filled in.

After this change, the firmware-manual-efi-tdx test case is
augmented with some additional information. Even more information
will be filled in later, when we improve the matching logic.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_firmware.c
tests/qemuxmlconfdata/firmware-manual-efi-tdx.x86_64-latest+inteltdx.xml

index 9ba5d899fadf2882351f5cc400c81cea8d03645a..7953b297bc80d275767914c2e4b13a1b362c740f 100644 (file)
@@ -1913,13 +1913,11 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
         return -1;
     }
 
-    /* If firmware autoselection is disabled and the loader is a ROM
-     * instead of a PFLASH device, then we're using BIOS and we don't
-     * need any information at all */
-    if (!autoSelection &&
-        (!loader || (loader && loader->type == VIR_DOMAIN_LOADER_TYPE_ROM))) {
+    /* If firmware autoselection is disabled and no information
+     * related to the loader was provided, then we're using the
+     * default built-in firmware and we can stop here */
+    if (!autoSelection && !loader)
         return 0;
-    }
 
     /* Look for the information we need in firmware descriptors */
     if ((ret = qemuFirmwareFillDomainModern(driver, def)) < 0)
index 7428a3dfefebba12674a9b0a4167f119fcc9899d..cdb92dcf1d2ee5680d0de5ef61777ca4ccbb4800 100644 (file)
@@ -6,7 +6,7 @@
   <vcpu placement='static'>1</vcpu>
   <os>
     <type arch='x86_64' machine='pc-q35-10.0'>hvm</type>
-    <loader readonly='yes' type='rom'>/usr/share/edk2/ovmf/OVMF.inteltdx.secboot.fd</loader>
+    <loader readonly='yes' type='rom' format='raw'>/usr/share/edk2/ovmf/OVMF.inteltdx.secboot.fd</loader>
     <boot dev='hd'/>
   </os>
   <features>