Replace some (but not all) interpolations of $ho->{Name} in filenames with hostnamepath($ho).
I searched the tree for `{Host}' and `{Name}', looking for paths which need (or might need) to be qualified with an L0 hostname in an L1 or L2 case. I have left ts-logs-capture for now; that will come in a moment. Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com> --- Osstest/TestSupport.pm | 8 ++++---- Osstest/Toolstack/libvirt.pm | 2 +- ts-host-install | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 38386d4..d0acdc6 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -469,7 +469,7 @@ sub target_somefile_getleaf ($$$) { $$lleaf_ref= $rdest; $$lleaf_ref =~ s,.*/,,; } - $$lleaf_ref= "$ho->{Name}--$$lleaf_ref"; + $$lleaf_ref= hostnamepath($ho)."--$$lleaf_ref"; } sub tpfcs_core { @@ -2345,7 +2345,7 @@ sub setup_pxelinux_bootcfg ($$) { my ($ho, $bootfile) = @_; my $f= host_pxefile($ho); file_link_contents("$ho->{Tftp}{Path}$ho->{Tftp}{PxeDir}$f", $bootfile, - "$ho->{Name}-pxelinux.cfg"); + hostnamepath($ho)."-pxelinux.cfg"); } # Systems using BIOS are configured to use pxelinux @@ -2386,14 +2386,14 @@ sub setup_grub_efi_bootcfg ($$) { my $f = "grub.cfg-$ho->{Ether}"; my $grub= $ho->{Tftp}{Path}.'/'.$ho->{Tftp}{GrubBase}.'/'. $c{TftpGrubVersion}."/pxegrub-$r{arch}.efi"; - my $pxe=$ho->{Tftp}{Path}.'/'.$ho->{Name}.'/pxe.img'; + my $pxe=$ho->{Tftp}{Path}.'/'.hostnamepath($ho).'/pxe.img'; logm("Copy $grub => $pxe"); copy($grub, $pxe) or die "Copy $grub to $pxe failed: $!"; logm("grub_efi bootcfg into $f"); file_link_contents("$ho->{Tftp}{Path}$ho->{Tftp}{TmpDir}$f", - $bootfile, "$ho->{Name}-pxegrub.cfg"); + $bootfile, hostnamepath($ho)."-pxegrub.cfg"); } # UEFI systems PXE boot using grub.efi diff --git a/Osstest/Toolstack/libvirt.pm b/Osstest/Toolstack/libvirt.pm index 776432d..69ff0bb 100644 --- a/Osstest/Toolstack/libvirt.pm +++ b/Osstest/Toolstack/libvirt.pm @@ -48,7 +48,7 @@ sub create ($$) { my $cfg = $gho->{CfgPath}; my $lcfg = $cfg; $lcfg =~ s,/,-,g; - $lcfg = "$ho->{Name}--$lcfg"; + $lcfg = hostnamepath($ho)."--$lcfg"; target_cmd_root($ho, "virsh domxml-from-native xen-xl $cfg > $cfg.xml", 30); target_getfile_root($ho,60,"$cfg.xml", "$stash/$lcfg"); target_cmd_root($ho, "virsh create --file $cfg.xml", 100); diff --git a/ts-host-install b/ts-host-install index 1cacd07..cfa6044 100755 --- a/ts-host-install +++ b/ts-host-install @@ -208,7 +208,7 @@ sub setup_pxeboot_firstboot($) { $kernel = "/$d_i/linux" unless $kernel; - my $initrd_overlay= "tmp/t.$ho->{Name}.initrd"; + my $initrd_overlay= "tmp/t.".hostnamepath($ho).".initrd"; system qw(rm -rf --),"$initrd_overlay.d"; mkdir "$initrd_overlay.d" or die "$initrd_overlay.d: $!"; @@ -253,7 +253,7 @@ END push @initrds, "$initrd_overlay.cpio.gz"; logm("using initrds: @initrds"); - my $initrd= "$ho->{Tftp}{TmpDir}$ho->{Name}--initrd.gz"; + my $initrd= "$ho->{Tftp}{TmpDir}".hostnamepath($ho)."--initrd.gz"; system_checked("cat -- @initrds >$ho->{Tftp}{Path}$initrd"); push @dicmdline, "domain=$c{TestHostDomain}"; -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel