You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.0 KiB
65 lines
2.0 KiB
From 8b337691d19e1619f711b437b2618ac269e5e12f Mon Sep 17 00:00:00 2001
|
|
Message-ID: <8b337691d19e1619f711b437b2618ac269e5e12f.1772815313.git.jdenemar@redhat.com>
|
|
From: Andrea Bolognani <abologna@redhat.com>
|
|
Date: Fri, 21 Nov 2025 19:32:31 +0100
|
|
Subject: [PATCH] qemu: Validate presence of uefi-vars device
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
The use of varstore requires the uefi-vars device to be present
|
|
in the QEMU binary.
|
|
|
|
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
(cherry picked from commit bd3504651759afac45e76b73912952bf2af2bcfa)
|
|
|
|
https://issues.redhat.com/browse/RHEL-82645
|
|
|
|
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
|
---
|
|
src/qemu/qemu_validate.c | 20 ++++++++++++++++++++
|
|
1 file changed, 20 insertions(+)
|
|
|
|
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
|
|
index aa441188cb..25e1b9cf58 100644
|
|
--- a/src/qemu/qemu_validate.c
|
|
+++ b/src/qemu/qemu_validate.c
|
|
@@ -754,6 +754,23 @@ qemuValidateDomainDefNvram(const virDomainDef *def,
|
|
}
|
|
|
|
|
|
+static int
|
|
+qemuValidateDomainDefVarstore(const virDomainDef *def,
|
|
+ virQEMUCaps *qemuCaps)
|
|
+{
|
|
+ if (!def->os.varstore)
|
|
+ return 0;
|
|
+
|
|
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_UEFI_VARS)) {
|
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
+ _("The uefi-vars device is not supported by this QEMU binary"));
|
|
+ return -1;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+
|
|
static int
|
|
qemuValidateDomainDefBoot(const virDomainDef *def,
|
|
virQEMUCaps *qemuCaps)
|
|
@@ -797,6 +814,9 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
|
|
|
|
if (qemuValidateDomainDefNvram(def, qemuCaps) < 0)
|
|
return -1;
|
|
+
|
|
+ if (qemuValidateDomainDefVarstore(def, qemuCaps) < 0)
|
|
+ return -1;
|
|
}
|
|
|
|
for (i = 0; i < def->os.nacpiTables; i++) {
|
|
--
|
|
2.53.0
|
|
|