[libvirt] [PATCH] util: Remove logging handlers in virExec

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

 



This allows debug statements and raised errors in hook functions to
actually be logged somewhere (stderr). Users can enable debugging in the
daemon and now see more info in /var/log/libvirt/...

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

diff --git a/src/util/util.c b/src/util/util.c
index 44a4b2f..23d781d 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -334,6 +334,7 @@ __virExec(virConnectPtr conn,
     int pipeerr[2] = {-1,-1};
     int childout = -1;
     int childerr = -1;
+    int logprio;
     sigset_t oldmask, newmask;
     struct sigaction sig_action;
 
@@ -452,6 +453,11 @@ __virExec(virConnectPtr conn,
        of being seen / logged */
     virSetErrorFunc(NULL, NULL);
 
+    /* Make sure any hook logging is sent to stderr */
+    logprio = virLogGetDefaultPriority();
+    virLogReset();
+    virLogSetDefaultPriority(logprio);
+
     /* Clear out all signal handlers from parent so nothing
        unexpected can happen in our child once we unblock
        signals */
-- 
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]