]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Make sure virExec hook failures are raised
authorCole Robinson <crobinso@redhat.com>
Wed, 13 Jan 2010 20:22:28 +0000 (15:22 -0500)
committerCole Robinson <crobinso@redhat.com>
Thu, 14 Jan 2010 14:19:39 +0000 (09:19 -0500)
With the introduction virDispatchError, hook function errors are
never sent through the error callback, so users will never see
these messages.

Fix this by calling virDispatchError after hook failure.

src/util/util.c

index ba6b0dbbca354403276f0fbca916dc04b7b38a69..45ca65750aac0597c21151e1daa4acf6a384e851 100644 (file)
@@ -557,8 +557,11 @@ __virExec(virConnectPtr conn,
     }
 
     if (hook)
-        if ((hook)(data) != 0)
+        if ((hook)(data) != 0) {
+            VIR_DEBUG0("Hook function failed.");
+            virDispatchError(NULL);
             _exit(1);
+        }
 
     /* The steps above may need todo something privileged, so
      * we delay clearing capabilities until the last minute */