stop excessive libvirt logging

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=149
This commit is contained in:
James Fehlig 2011-09-14 21:56:38 +00:00 committed by Git OBS Bridge
parent 769c19d519
commit 66a9d8b90f
4 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,41 @@
commit 6ff9fc26d3672cd6e822a20a70d9d36ee3e0c173
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Wed Aug 31 16:53:09 2011 +0100
Stop libxl driver polluting logs on non-Xen hosts
If the libxl driver is compiled in, then everytime libvirtd
starts up on a non-Xen Dom0 host, it logs a error message.
Since this is an expected condition, we should not log at
'error' level, only 'info'.
* src/libxl/libxl_driver.c: Lower log level for certain
expected errors during driver init
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index d6e0c28..91da438 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -963,19 +963,19 @@ libxlStartup(int privileged) {
libxl_driver->logger =
(xentoollog_logger *)xtl_createlogger_stdiostream(libxl_driver->logger_file, XTL_DEBUG, 0);
if (!libxl_driver->logger) {
- VIR_ERROR(_("cannot create logger for libxenlight"));
+ VIR_INFO("cannot create logger for libxenlight, disabling driver");
goto fail;
}
if (libxl_ctx_init(&libxl_driver->ctx,
LIBXL_VERSION,
libxl_driver->logger)) {
- VIR_ERROR(_("cannot initialize libxenlight context"));
+ VIR_INFO("cannot initialize libxenlight context, probably not running in a Xen Dom0, disabling driver");
goto fail;
}
if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
- VIR_ERROR(_("cannot version information from libxenlight"));
+ VIR_INFO("cannot version information from libxenlight, disabling driver");
goto fail;
}
libxl_driver->version = (ver_info->xen_version_major * 1000000) +

View File

@ -0,0 +1,30 @@
commit 7f2498efe45505135ed75c6548c21a89674cb6ba
Author: Daniel Veillard <veillard@redhat.com>
Date: Tue Sep 13 18:24:13 2011 +0800
Do not log invalid operations in libvirtd logs
This is a bit painful for example when starting virt-manager
it tends to clutter libvirtd.log with invalid operation on cpu pinning
for defined but not running domains. A priori those kind of errors
don't indicate an error when executing the command but on a precondition
for running the API, and honnestly while the application should report
it, logging it as an error in libvirtd.log is not really useful,
Related bug: https://bugzilla.redhat.com/show_bug.cgi?id=590807
* daemon/libvirtd.c: extend daemonErrorLogFilter() to filter out
errors of type VIR_ERR_OPERATION_INVALID
Index: libvirt-0.9.4/daemon/libvirtd.c
===================================================================
--- libvirt-0.9.4.orig/daemon/libvirtd.c
+++ libvirt-0.9.4/daemon/libvirtd.c
@@ -392,6 +392,7 @@ static int daemonErrorLogFilter(virError
case VIR_ERR_NO_NWFILTER:
case VIR_ERR_NO_SECRET:
case VIR_ERR_NO_DOMAIN_SNAPSHOT:
+ case VIR_ERR_OPERATION_INVALID:
return VIR_LOG_DEBUG;
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Sep 14 15:49:37 MDT 2011 - jfehlig@suse.com
- Add upstream patches to stop excessive logging
7f2498ef-no-log-invalid.patch 6ff9fc26-quiet-libxl-logging.patch
-------------------------------------------------------------------
Wed Sep 14 12:06:36 MDT 2011 - jfehlig@suse.com

View File

@ -361,6 +361,8 @@ Source2: libvirtd-relocation-server.fw
Source99: baselibs.conf
# Upstream patches
Patch0: 9e093f0b-libvirtd-sighup.patch
Patch1: 6ff9fc26-quiet-libxl-logging.patch
Patch2: 7f2498ef-no-log-invalid.patch
# Need to go upstream
Patch100: xen-name-for-devid.patch
Patch101: clone.patch
@ -480,6 +482,8 @@ Authors:
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch100 -p1
%patch101
%patch102 -p1