mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
qemu: Validate presence of uefi-vars device
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>
This commit is contained in:
1 parent
12cdd61383
commit
bd35046517
1 file changed
+20
@@ -753,6 +753,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)
|
||||
@@ -796,6 +813,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++) {
|
||||
|
||||
Reference in new issue
Block a user