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

[Xen-devel] [OSSTEST PATCH 3/7] Log capture pathnames: Include host name (and nested L0 name)



Rather than using $gho->{Name} (and, sometimes, separately
$ho->{Name}), use hostnamepath().

This means that the hostname is always included in the standard way.
The filename structure for xenctx and console snapshots changes
slightly.

In two cases this means that the hostname is now included where it
wasn't previously.  That is helpful if due to some insanity the same
guest is present on more than one host.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 ts-logs-capture |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ts-logs-capture b/ts-logs-capture
index cb0d371..86fad93 100755
--- a/ts-logs-capture
+++ b/ts-logs-capture
@@ -85,7 +85,7 @@ END
         foreach my $logfile (split / /, $logfileslist) {
             my $llogfile= $logfile;
             $llogfile =~ s,/,-,g;
-            $llogfile= "$lho->{Name}--$llogfile";
+            $llogfile= hostnamepath($lho)."--$llogfile";
             logm("fetching $logfile to $llogfile");
             if (!eval {
                 target_getfile_root($lho,60, $logfile,"$stash/$llogfile");
@@ -113,7 +113,7 @@ sub try_cmd_output_save ($;$) {
         $dfn =~ s,-,-,g;
         $dfn =~ s/ /_/g;
         $dfn =~ s/[^-+._,=0-9a-zA-Z]/#/g;
-        $dfn= $ho->{Name}."-output-$dfn";
+        $dfn= hostnamepath($ho)."-output-$dfn";
     }
     my $output;
     if (!eval {
@@ -219,7 +219,7 @@ sub fetch_xenctx_guest ($) {
                $kernpath !~ m,/vmlinuz-, ? die "$kernpath ?" :
                "-s $`/System.map-$'";
            foreach my $iter (0..1) {
-               my $dfn = "$ho->{Name}-xenctx-$gho->{Name},vcpu$vcpu,i$iter";
+               my $dfn = hostnamepath($ho)."-xenctx,vcpu$vcpu,i$iter";
                try_cmd_output_save(
                    'PATH=/usr/local/lib/xen/bin:/usr/lib/xen/bin:$PATH; '.
                    "xenctx $sysmaparg $gho->{Domid} $vcpu",
@@ -236,11 +236,12 @@ sub fetch_logs_guest ($) {
 
     my $consolecmd= toolstack($ho)->consolecmd($gho);
     try_cmd_output_save("sleep 1 | $consolecmd | cat",
-                        "guest-$gho->{Name}-console");
+                        "guest-".hostnamepath($gho)."-console");
 
     if (!eval {
         my $vnc= guest_vncsnapshot_begin($ho,$gho);
-        guest_vncsnapshot_stash($ho,$gho,$vnc, "$gho->{Name}--vnc.jpeg");
+        guest_vncsnapshot_stash($ho,$gho,$vnc,
+                               hostnamepath($gho)."-vnc.jpeg");
         1;
     }) {
         logm("cannot get vnc snapshot: $@");
-- 
1.7.10.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®.