[libvirt] [PATCH] util: Make sure virExec hook failures are raised

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

 



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.

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 src/util/util.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/util/util.c b/src/util/util.c
index ba6b0db..45ca657 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -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 */
-- 
1.6.5.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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]