mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: Fix virDomainDefOSValidate()
Even when the os.loader element is absent, we still have to validate that the user is not attempting to use firmware autoselection with a driver that doesn't implement the feature. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
69464f4280
commit
58805f3ace
@ -1598,9 +1598,6 @@ static int
|
||||
virDomainDefOSValidate(const virDomainDef *def,
|
||||
virDomainXMLOption *xmlopt)
|
||||
{
|
||||
if (!def->os.loader)
|
||||
return 0;
|
||||
|
||||
if (def->os.firmware &&
|
||||
!(xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT)) {
|
||||
virReportError(VIR_ERR_XML_DETAIL, "%s",
|
||||
@ -1608,6 +1605,9 @@ virDomainDefOSValidate(const virDomainDef *def,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!def->os.loader)
|
||||
return 0;
|
||||
|
||||
if (!def->os.loader->path &&
|
||||
def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE) {
|
||||
virReportError(VIR_ERR_XML_DETAIL, "%s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user