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>
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);
}
}