From dbfca3ff70cffccd4d7b638028ca7ddc2fba3c86 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 21 Jan 2011 16:46:16 +0000 Subject: [PATCH] Revert all previous error log priority hacks This reverts the additions in commit abff683f78ffd01df5005fb7a457c0b38b8eb6e1 taking us back to state where all errors are fully logged in both libvirtd and normal clients. THe intent was to stop VIR_ERR_NO_DOMAIN (No such domain with UUID XXXX) messages from client apps polluting syslog The change affected all error codes, but more seriously, it also impacted errors from internal libvirtd infrastructure For example guest autostart no longer logged errors. The libvirtd network code no longer logged some errors. This makes debugging incredibly hard * daemon/libvirtd.c: Remove error log priority filter * src/util/virterror.c, src/util/virterror_internal.h: Remove callback for overriding log priority --- daemon/libvirtd.c | 4 ---- src/libvirt_private.syms | 1 - src/util/virterror.c | 14 +------------- src/util/virterror_internal.h | 1 - 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index b1539b10d3..e6d73cc142 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -3103,10 +3103,6 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - /* Set error logging priority to debug, so client errors don't - * show up as errors in the daemon log */ - virErrorSetLogPriority(VIR_LOG_DEBUG); - while (1) { int optidx = 0; int c; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index c7e4772250..003fc63d31 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -918,7 +918,6 @@ virAuditSend; # virterror_internal.h virDispatchError; virErrorMsg; -virErrorSetLogPriority; virRaiseErrorFull; virReportErrorHelper; virReportOOMErrorFull; diff --git a/src/util/virterror.c b/src/util/virterror.c index 3dd6256f50..91302846b5 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -26,7 +26,6 @@ virThreadLocal virLastErr; virErrorFunc virErrorHandler = NULL; /* global error handler */ void *virUserData = NULL; /* associated data */ -static int virErrorLogPriority = -1; /* * Macro used to format the message as a string in virRaiseError @@ -725,13 +724,8 @@ virRaiseErrorFull(virConnectPtr conn ATTRIBUTE_UNUSED, /* * Hook up the error or warning to the logging facility * XXXX should we include filename as 'category' instead of domain name ? - * - * When an explicit error log priority is set then use it, otherwise - * translate the error level to the log priority. This is used by libvirtd - * to log client errors at debug priority. */ - priority = virErrorLogPriority == -1 ? virErrorLevelPriority(level) - : virErrorLogPriority; + priority = virErrorLevelPriority(level); virLogMessage(virErrorDomainName(domain), priority, funcname, linenr, 1, "%s", str); @@ -1341,9 +1335,3 @@ void virReportOOMErrorFull(int domcode, domcode, VIR_ERR_NO_MEMORY, VIR_ERR_ERROR, virerr, NULL, NULL, -1, -1, virerr, NULL); } - -void -virErrorSetLogPriority(int priority) -{ - virErrorLogPriority = priority; -} diff --git a/src/util/virterror_internal.h b/src/util/virterror_internal.h index 2dd2b4aff4..601a88472f 100644 --- a/src/util/virterror_internal.h +++ b/src/util/virterror_internal.h @@ -89,6 +89,5 @@ void virReportOOMErrorFull(int domcode, int virSetError(virErrorPtr newerr); void virDispatchError(virConnectPtr conn); const char *virStrerror(int theerrno, char *errBuf, size_t errBufLen); -void virErrorSetLogPriority(int priority); #endif -- GitLab