]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_validate: Check whether UEFI shim is supported
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 5 Mar 2025 14:04:21 +0000 (15:04 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 10 Mar 2025 12:53:06 +0000 (13:53 +0100)
If UEFI shim is specified in domain XML but QEMU is too old, then
report an error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_validate.c

index 4ab7af36f38ffffd1bc94fd74c71aba1bd3307cd..f117441eceffddd712e408abb5821b9a09d9c66a 100644 (file)
@@ -763,6 +763,13 @@ qemuValidateDomainDefBoot(const virDomainDef *def,
         }
     }
 
+    if (def->os.shim &&
+        !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_SHIM)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("shim is not supported by this QEMU binary"));
+        return -1;
+    }
+
     return 0;
 }