]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
ts-guests-nbd-mirror: use target_{get,put}file_root to transfter cfg
authorWei Liu <wei.liu2@citrix.com>
Mon, 30 Oct 2017 14:34:20 +0000 (14:34 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 10 Apr 2019 14:12:29 +0000 (15:12 +0100)
The original code used target_cmd_output_root which caused a trailing
new line to be deleted, which caused libvirt converter to fail.

It wasn't discovered until now because we appended too many "\n".

Use target_{get,put}file_root to do the job.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
ts-guests-nbd-mirror

index 7ea31f7c7bd4af1ca333436c05fac54201769e17..06903aaa83a905c37003a71662a41675d8de4310 100755 (executable)
@@ -154,8 +154,11 @@ sub shuffleconfigs () {
        my $gn= $gns[$i];
        my $gho= $ghos[$i];
        my $cfgpath= $r{ "$gho->{Guest}_cfgpath" };
-       my $cfgdata= target_cmd_output_root($sho,"cat $cfgpath");
-       target_putfilecontents_root_stash($cho,10,$cfgdata,$cfgpath);
+       my $file= $cfgpath;
+       $file=~ s,/,-,g;
+       $file= "$stash/".hostnamepath($cho)."--$file";
+       target_getfile_root($sho, 60, $cfgpath, $file);
+       target_putfile_root($cho, 60, $file, $cfgpath);
     }
 }