libxl: Forbid domain definition with secure boot enabled

Xen+ovmf does not support secure boot. Fail domain def validation
if secure boot is enabled.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jim Fehlig 2021-06-02 14:39:43 -06:00
parent d36be9ffe3
commit 7c5507df10

View File

@ -446,6 +446,16 @@ libxlDomainDefValidate(const virDomainDef *def,
def->virtType))
return -1;
/* Xen+ovmf does not support secure boot */
if (virDomainDefHasOldStyleUEFI(def)) {
if (def->os.loader &&
def->os.loader->secure == VIR_TRISTATE_BOOL_YES) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Secure boot is not supported on Xen"));
return -1;
}
}
return 0;
}