From: Ian Campbell Subject: [PATCH v3] ts-xen-install: Enable debug level logging in libvirt Date: Tue, 3 Mar 2015 10:22:05 +0000 Message-ID: <1425378125-15529-1-git-send-email-ian.campbell@citrix.com> References: <21748.17434.507737.803713@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21748.17434.507737.803713@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Jim Fehlig , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org This should make diagnosing libvirt issues a bit easier. Refactor the existing loop to edit the xencommons kvp style config file editing code so it can be reused for libvirtd.conf. Signed-off-by: Ian Campbell Cc: Jim Fehlig Acked-by: Ian Jackson --- v3: Only apply if toolstack==libvirt, else we break non-libvirt tests. Now tested with test-amd64-amd64-xl as well as -libvirt. v2: Match key\b --- ts-xen-install | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ts-xen-install b/ts-xen-install index 7cfe344..5282f0a 100755 --- a/ts-xen-install +++ b/ts-xen-install @@ -114,19 +114,27 @@ sub adjustconfig () { } die unless defined $trace_config_file; - target_editfile_root($ho, $trace_config_file, sub { + my $kvp_replace = sub($$) { + my ($key,$value) = @_; my $prnow; $prnow= sub { - print EO "XENCONSOLED_TRACE=guest\n" or die $!; + print EO "$key=$value\n" or die $!; $prnow= sub { }; }; while () { - print EO or die $! unless m/^XENCONSOLED_TRACE/; - $prnow->() if m/^#XENCONSOLED_TRACE/; + print EO or die $! unless m/^$key\b/; + $prnow->() if m/^#$key/; } print EO "\n" or die $!; $prnow->(); - }); + }; + + target_editfile_root($ho, $trace_config_file, + sub { $kvp_replace->("XENCONSOLED_TRACE", "guest") }); + + target_editfile_root($ho, '/etc/libvirt/libvirtd.conf', + sub { $kvp_replace->("log_level", "1") }) + if toolstack($ho)->{Name} eq "libvirt"; target_cmd_root($ho, 'mkdir -p /var/log/xen/console'); -- 2.1.4