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 <ian.campb...@citrix.com> Cc: Jim Fehlig <jfeh...@suse.com> --- 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 (<EI>) { - 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel