forked from rpms/libvirt
- tests: Use DO_TEST_CAPS_*_ABI_UPDATE() for ppc64 (rhbz#2196178) - tests: Switch to firmware autoselection for hvf (rhbz#2196178) - tests: Use virt-4.0 machine type for aarch64 (rhbz#2196178) - tests: Consistently use /path/to/guest_VARS.fd (rhbz#2196178) - tests: Turn abi-update.xml into a symlink (rhbz#2196178) - tests: Rename firmware-auto-efi-nvram-path (rhbz#2196178) - qemu: Fix return value for qemuFirmwareFillDomainLegacy() (rhbz#2196178) - qemu: Fix lookup against stateless/combined pflash (rhbz#2196178) - tests: Add some more DO_TEST*ABI_UPDATE* macros (rhbz#2196178) - tests: Add more tests for firmware selection (rhbz#2196178) - tests: Update firmware descriptor files (rhbz#2196178) - tests: Drop tags from BIOS firmware descriptor (rhbz#2196178) - tests: Include microvm in firmwaretest (rhbz#2196178) - qemu: Don't overwrite NVRAM template for legacy firmware (rhbz#2196178) - qemu: Generate NVRAM path in more cases (rhbz#2196178) - qemu: Filter firmware based on loader.readonly (rhbz#2196178) - qemu: Match NVRAM template extension for new domains (rhbz#2196178) - conf: Don't default to raw format for loader/NVRAM (rhbz#2196178) - tests: Rename firmware-auto-efi-format-loader-qcow2-nvram-path (rhbz#2196178) - tests: Reintroduce firmware-auto-efi-format-mismatch (rhbz#2196178) - rpm: Reorder scriptlets (rhbz#2210058) - rpm: Reduce use of with_modular_daemons (rhbz#2210058) - rpm: Remove custom libvirtd restart logic (rhbz#2210058) - rpm: Introduce new macros for handling of systemd units (rhbz#2210058) - rpm: Switch to new macros for handling of systemd units (rhbz#2210058) - rpm: Delete unused macros (rhbz#2210058) Resolves: rhbz#2196178, rhbz#2210058
47 lines
1.8 KiB
Diff
47 lines
1.8 KiB
Diff
From f57a07068f7cc7ccdbf9814f9c69cbef1d2c9d6c Mon Sep 17 00:00:00 2001
|
|
Message-ID: <f57a07068f7cc7ccdbf9814f9c69cbef1d2c9d6c.1692951632.git.jdenemar@redhat.com>
|
|
From: Andrea Bolognani <abologna@redhat.com>
|
|
Date: Fri, 26 May 2023 17:47:42 +0200
|
|
Subject: [PATCH] qemu: Fix lookup against stateless/combined pflash
|
|
|
|
Just like the more common split builds, these are of type
|
|
QEMU_FIRMWARE_DEVICE_FLASH; however, they have no associated
|
|
NVRAM template, so we can't access the corresponding structure
|
|
member unconditionally or we'll trigger a crash.
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
|
|
|
|
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
(cherry picked from commit ac76386edad3be2bbd6202a30063b9205011f5c5)
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=2196178
|
|
|
|
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
|
---
|
|
src/qemu/qemu_firmware.c | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
|
|
index 5f030ebce4..b1d342563b 100644
|
|
--- a/src/qemu/qemu_firmware.c
|
|
+++ b/src/qemu/qemu_firmware.c
|
|
@@ -971,9 +971,12 @@ qemuFirmwareMatchesPaths(const qemuFirmware *fw,
|
|
if (loader && loader->path &&
|
|
STRNEQ(loader->path, flash->executable.filename))
|
|
return false;
|
|
- if (loader && loader->nvramTemplate &&
|
|
- STRNEQ(loader->nvramTemplate, flash->nvram_template.filename))
|
|
- return false;
|
|
+ if (loader && loader->nvramTemplate) {
|
|
+ if (flash->mode != QEMU_FIRMWARE_FLASH_MODE_SPLIT)
|
|
+ return false;
|
|
+ if (STRNEQ(loader->nvramTemplate, flash->nvram_template.filename))
|
|
+ return false;
|
|
+ }
|
|
break;
|
|
case QEMU_FIRMWARE_DEVICE_MEMORY:
|
|
if (loader && loader->path &&
|
|
--
|
|
2.42.0
|