From 66a9d8b90f17ead88c512e8c648c5a32d13865cd53dd2ccc2ea4197f1ed24e82 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Wed, 14 Sep 2011 21:56:38 +0000 Subject: [PATCH] stop excessive libvirt logging OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=149 --- 6ff9fc26-quiet-libxl-logging.patch | 41 ++++++++++++++++++++++++++++++ 7f2498ef-no-log-invalid.patch | 30 ++++++++++++++++++++++ libvirt.changes | 6 +++++ libvirt.spec | 4 +++ 4 files changed, 81 insertions(+) create mode 100644 6ff9fc26-quiet-libxl-logging.patch create mode 100644 7f2498ef-no-log-invalid.patch diff --git a/6ff9fc26-quiet-libxl-logging.patch b/6ff9fc26-quiet-libxl-logging.patch new file mode 100644 index 0000000..bb26d67 --- /dev/null +++ b/6ff9fc26-quiet-libxl-logging.patch @@ -0,0 +1,41 @@ +commit 6ff9fc26d3672cd6e822a20a70d9d36ee3e0c173 +Author: Daniel P. Berrange +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) + diff --git a/7f2498ef-no-log-invalid.patch b/7f2498ef-no-log-invalid.patch new file mode 100644 index 0000000..44392f3 --- /dev/null +++ b/7f2498ef-no-log-invalid.patch @@ -0,0 +1,30 @@ +commit 7f2498efe45505135ed75c6548c21a89674cb6ba +Author: Daniel Veillard +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; + } + diff --git a/libvirt.changes b/libvirt.changes index 62d54d0..3285e6b 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -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 diff --git a/libvirt.spec b/libvirt.spec index 498e621..b50d965 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -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