]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: set postParseFailed even without ALLOW_POST_PARSE_FAIL
authorJán Tomko <jtomko@redhat.com>
Fri, 2 Mar 2018 14:12:49 +0000 (15:12 +0100)
committerJán Tomko <jtomko@redhat.com>
Mon, 5 Mar 2018 12:25:20 +0000 (13:25 +0100)
We allow the postParse callbacks to fail for some reasons (missing
emulator binary) when parsing the configs from /etc/libvirt.
In that case, def->postParseFailed is set to true and the post
parse callbacks are re-executed on domain startup.

However this bool was only set when virDomainDefPostParse was called
with the ALLOW_POST_PARSE_FAIL flag set. If the callback failed
again on domain startup, the bool would be reset and subsequent
startups would not attempt to reexecute the callback.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c

index fcafc8b2fafe0b90e4ee2671fe1377240d6cdc9f..a248d73de3736064456f169d1db3e6389b23fa7b 100644 (file)
@@ -5027,6 +5027,9 @@ virDomainDefPostParseCheckFailure(virDomainDefPtr def,
                                   unsigned int parseFlags,
                                   int ret)
 {
+    if (ret != 0)
+        def->postParseFailed = true;
+
     if (ret <= 0)
         return ret;
 
@@ -5034,7 +5037,6 @@ virDomainDefPostParseCheckFailure(virDomainDefPtr def,
         return -1;
 
     virResetLastError();
-    def->postParseFailed = true;
     return 0;
 }