From: Ian Campbell Subject: [PATCH v2] ts-xen-install: Enable debug level logging in libvirt Date: Mon, 2 Mar 2015 11:33:45 +0000 Message-ID: <1425296025-17955-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 --- v2: Match key\b --- ts-xen-install | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ts-xen-install b/ts-xen-install index 7cfe344..044bcc8 100755 --- a/ts-xen-install +++ b/ts-xen-install @@ -114,19 +114,26 @@ 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") }); target_cmd_root($ho, 'mkdir -p /var/log/xen/console'); -- 2.1.4