There are currently no failure scenarios for the function, but
we're about to add one.

Signed-off-by: Andrea Bolognani <abolo...@redhat.com>
---
 src/conf/domain_conf.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3977b5040f..d88d352fb6 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4873,7 +4873,7 @@ virDomainDefPostParseMemory(virDomainDef *def,
 }
 
 
-static void
+static int
 virDomainDefPostParseOs(virDomainDef *def)
 {
     if (def->os.firmwareFeatures &&
@@ -4887,13 +4887,15 @@ virDomainDefPostParseOs(virDomainDef *def)
     }
 
     if (!def->os.loader)
-        return;
+        return 0;
 
     if (def->os.loader->path &&
         def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_NONE) {
         /* By default, loader is type of 'rom' */
         def->os.loader->type = VIR_DOMAIN_LOADER_TYPE_ROM;
     }
+
+    return 0;
 }
 
 
@@ -6214,7 +6216,8 @@ virDomainDefPostParseCommon(virDomainDef *def,
     if (virDomainDefPostParseMemory(def, data->parseFlags) < 0)
         return -1;
 
-    virDomainDefPostParseOs(def);
+    if (virDomainDefPostParseOs(def) < 0)
+        return -1;
 
     virDomainDefPostParseMemtune(def);
 
-- 
2.35.3

Reply via email to