提交 28613908 编写于 作者: C Cole Robinson

util: Remove logging handlers in virExec

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/...
上级 6c6fbac7
......@@ -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,13 @@ __virExec(virConnectPtr conn,
of being seen / logged */
virSetErrorFunc(NULL, NULL);
/* Make sure any hook logging is sent to stderr, since virExec will
* close any unknown FDs (including logging handlers) before launching
* the new process */
logprio = virLogGetDefaultPriority();
virLogReset();
virLogSetDefaultPriority(logprio);
/* Clear out all signal handlers from parent so nothing
unexpected can happen in our child once we unblock
signals */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册