From d7a1722cf4852293ee12842cca40ff744ec15a7875a08e8c07d61d012ce8b1cc Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 15 Sep 2015 17:45:03 +0000 Subject: [PATCH] - libxl: set driver log level to the log_level specified in libvirtd.conf ba25c214-libxl-log-level.patch bsc#945796 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=486 --- ba25c214-libxl-log-level.patch | 51 ++++++++++++++++++++++++++++++++++ libvirt.changes | 8 ++++++ libvirt.spec | 4 ++- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 ba25c214-libxl-log-level.patch diff --git a/ba25c214-libxl-log-level.patch b/ba25c214-libxl-log-level.patch new file mode 100644 index 0000000..a538721 --- /dev/null +++ b/ba25c214-libxl-log-level.patch @@ -0,0 +1,51 @@ +commit ba25c214f7c622c75448e760f3204844cfff50d0 +Author: Jim Fehlig +Date: Tue Sep 15 08:17:44 2015 -0600 + + libxl: open libxl log stream with libvirtd log_level + + Instead of a hardcoded DEBUG log level, use the overall + daemon log level specified in libvirtd.conf when opening + a log stream with libxl. libxl is very verbose when DEBUG + log level is set, resulting in huge log files that can + potentially fill a disk. Control of libxl verbosity should + be placed in the administrator's hands. + +Index: libvirt-1.2.18/src/libxl/libxl_conf.c +=================================================================== +--- libvirt-1.2.18.orig/src/libxl/libxl_conf.c ++++ libvirt-1.2.18/src/libxl/libxl_conf.c +@@ -1495,6 +1495,7 @@ libxlDriverConfigNew(void) + { + libxlDriverConfigPtr cfg; + char *log_file = NULL; ++ xentoollog_level log_level; + char ebuf[1024]; + unsigned int free_mem; + +@@ -1539,9 +1540,24 @@ libxlDriverConfigNew(void) + } + VIR_FREE(log_file); + ++ switch (virLogGetDefaultPriority()) { ++ case VIR_LOG_DEBUG: ++ log_level = XTL_DEBUG; ++ break; ++ case VIR_LOG_INFO: ++ log_level = XTL_INFO; ++ break; ++ case VIR_LOG_WARN: ++ log_level = XTL_WARN; ++ break; ++ case VIR_LOG_ERROR: ++ log_level = XTL_ERROR; ++ break; ++ } ++ + cfg->logger = + (xentoollog_logger *)xtl_createlogger_stdiostream(cfg->logger_file, +- XTL_DEBUG, XTL_STDIOSTREAM_SHOW_DATE); ++ log_level, XTL_STDIOSTREAM_SHOW_DATE); + if (!cfg->logger) { + VIR_ERROR(_("cannot create logger for libxenlight, disabling driver")); + goto error; diff --git a/libvirt.changes b/libvirt.changes index a2fa785..62ba572 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Sep 15 17:37:36 UTC 2015 - jfehlig@suse.com + +- libxl: set driver log level to the log_level specified in + libvirtd.conf + ba25c214-libxl-log-level.patch + bsc#945796 + ------------------------------------------------------------------- Mon Sep 14 08:18:12 UTC 2015 - cbosdonnat@suse.com diff --git a/libvirt.spec b/libvirt.spec index d575602..71c694a 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -1,7 +1,7 @@ # # spec file for package libvirt # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -449,6 +449,7 @@ Source99: baselibs.conf Patch0: 3468542f-virFileUnlink.patch Patch1: 8b1d84e6-refreshVol-failure.patch Patch2: e0025d29-storage-mode-check.patch +Patch3: ba25c214-libxl-log-level.patch # Patches pending upstream review # Need to go upstream Patch150: xen-pv-cdrom.patch @@ -982,6 +983,7 @@ Provides a dissector for the libvirt RPC protocol to help debugging it. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %patch150 -p1 %patch151 -p1 %patch152 -p1