@@ -68,11 +68,13 @@ END
@guests = grep { defined $_->{Domid} } @allguests;
}
-sub try_fetch_logs ($$) {
- my ($lho, $logfilepats) = @_;
+sub try_fetch_logs ($$;$$) {
+ my ($lho, $logfilepats, $fs_prefix,$out_prefix) = @_;
+ $fs_prefix //= '';
+ $out_prefix //= '';
my $ok= 0;
foreach my $logfilepat (@$logfilepats) {
- my $logfileslist= $logfilepat;
+ my $logfileslist= $fs_prefix.$logfilepat;
if ($logfileslist =~ m/[*?]/) {
if (!eval {
$logfileslist=
@@ -91,8 +93,9 @@ END
}
foreach my $logfile (split / /, $logfileslist) {
my $llogfile= $logfile;
+ $llogfile =~ s,^\Q$fs_prefix\E,,;
$llogfile =~ s,/,-,g;
- $llogfile= hostnamepath($lho)."--$llogfile";
+ $llogfile= hostnamepath($lho)."-$out_prefix-$llogfile";
logm("fetching $logfile to $llogfile");
if (!eval {
target_getfile_root($lho,60, $logfile,"$stash/$llogfile");
This allows us to add some stuff to add to each pattern, and each filename. This will be useful in a moment. None of the call sites pass this yet. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> --- ts-logs-capture | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)