From: Ian Jackson Subject: [OSSTEST PATCH 3/7] Log capture pathnames: Include host name (and nested L0 name) Date: Mon, 16 Nov 2015 17:54:21 +0000 Message-ID: <1447696465-24978-4-git-send-email-ian.jackson@eu.citrix.com> References: <1447696465-24978-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZyNzB-0000FT-LT for xen-devel@lists.xenproject.org; Mon, 16 Nov 2015 17:54:37 +0000 In-Reply-To: <1447696465-24978-1-git-send-email-ian.jackson@eu.citrix.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: xen-devel@lists.xenproject.org Cc: Robert Ho , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 --- 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