[libvirt PATCH 2/3] conf: Fix virDomainDefOSValidate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux