]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Revert all previous error log priority hacks
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 21 Jan 2011 16:46:16 +0000 (16:46 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 26 Jan 2011 14:54:23 +0000 (14:54 +0000)
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
src/libvirt_private.syms
src/util/virterror.c
src/util/virterror_internal.h

index b1539b10d37e94542af952efb7e036a98c43cafb..e6d73cc1429e94eeea41a049ad0c4f9c46b6620a 100644 (file)
@@ -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;
index c7e47722508f099db9e2953f5590cc2156727c8e..003fc63d318a4e2350c0b01c7b2edc4d7e0e0717 100644 (file)
@@ -918,7 +918,6 @@ virAuditSend;
 # virterror_internal.h
 virDispatchError;
 virErrorMsg;
-virErrorSetLogPriority;
 virRaiseErrorFull;
 virReportErrorHelper;
 virReportOOMErrorFull;
index 3dd6256f50ff6152b81e96d1770a972f433d81c5..91302846b538b6100da32cec36ef459dcc32780c 100644 (file)
@@ -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;
-}
index 2dd2b4aff4a9d86149ae4a61d1d4b454cac7dab6..601a88472f8b3cce69d30c2a2ecf0ecb526a38e6 100644 (file)
@@ -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