]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
Nested hosts: Use full hostnamepath in various paths
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 16 Nov 2015 17:50:15 +0000 (17:50 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 17 Nov 2015 12:44:18 +0000 (12:44 +0000)
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.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Osstest/TestSupport.pm
Osstest/Toolstack/libvirt.pm
ts-host-install

index 38386d478783daa9b976892b40b93dfd93bd2c6c..d0acdc663c902a75df4a6a069b55a71f14cd3993 100644 (file)
@@ -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
index 776432d00ca4a6213eb65bf00673a5419ee2e6ae..69ff0bb640178ad84299d4b33b7f872bac7f1a6b 100644 (file)
@@ -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);
index 1cacd07a92ea9ea759ee32a924a26ad8a65c9750..cfa60445dc270eb205cf06be779e1eb36e641cbb 100755 (executable)
@@ -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}";