[PATCH v3 6/9] qemu: Fix matching for read/write firmware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We currently always pick a read-only firmware unless we are
explicitly asked for a read/write one, which is probably what
most people expect anyway but doesn't really make sense
otherwise: if no specific requirement has been provided by the
user, both read-only and read/write firmwares should be
allowed to match.

This won't result in any change in practice, since distros are
not shipping read/write builds of edk2 anyway. If they started
doing that, it would be their responsibility to ensure that
they are ordered after the read-only builds.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
Reviewed-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/qemu/qemu_firmware.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index 6ead61d59c..5bd34ea87f 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1318,6 +1318,13 @@ qemuFirmwareMatchDomain(const virDomainDef *def,
             return false;
         }
 
+        /* Same for read-only status */
+        if (loader &&
+            loader->readonly == VIR_TRISTATE_BOOL_YES &&
+            flash->mode == QEMU_FIRMWARE_FLASH_MODE_COMBINED) {
+            VIR_DEBUG("Discarding read/write loader");
+            return false;
+        }
         if (loader &&
             loader->readonly == VIR_TRISTATE_BOOL_NO &&
             flash->mode != QEMU_FIRMWARE_FLASH_MODE_COMBINED) {
-- 
2.51.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux