From 58805f3aced027a8105d30ae3aaff3ff783be235 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 9 Jun 2022 19:26:16 +0200 Subject: [PATCH] conf: Fix virDomainDefOSValidate() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- 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 10fb490e3c..33b6f47159 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -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", -- 2.47.2