On Thursday, 25 July 2019 16:01:59 CEST Richard W.M. Jones wrote:
Tested using:
cd v2v
LIBGUESTFS_BACKEND=direct ../run virt-v2v -i vmx -it ssh
"ssh://localhost/$PWD/test-v2v-i-vmx-1.vmx" -o null -v -x
and manually examining the debug output.
Thanks: Ming Xie, Jakub Jelen.
---
This (the issue, and the solution) is rather ugly, although I do not
see an easier solution than either
a) switch to the sftp(1) utility (and thus switch from scp to sftp)
b) use a ssh library (libssh) for fetching the vmx file
So for now I'd say to go with this, with the following fixes:
+let scp_supports_T_option = lazy (
+ let cmd = "LANG=C scp -T |& grep \"unknown option\"" in
+ if verbose () then
+ eprintf "%s\n%!" cmd;
+ Sys.command cmd <> 0
There is already Tools_utils.shell_command that does the 3 lines above.
Also, the Lazy is not needed here, as the vmx file is downloaded using
scp_from_remote_to_temporary only once. So I'd move the
scp_supports_T_option helper within scp_from_remote_to_temporary.
--
Pino Toscano