[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2] ts-xen-install: Enable debug level logging in libvirt



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.campbell@xxxxxxxxxx>
Cc: Jim Fehlig <jfehlig@xxxxxxxx>
---
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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.