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(a)redhat.com>
---
src/conf/domain_validate.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index f3910f08a4..61d4586580 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -1586,9 +1586,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",
@@ -1596,6 +1593,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",
--
2.35.3