|
|
da373f |
From f36bb1b9c44cda46afa1a34522202a5319fd0a5a Mon Sep 17 00:00:00 2001
|
|
|
c1122e |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
c1122e |
Date: Thu, 25 Jul 2019 14:52:42 +0100
|
|
|
c1122e |
Subject: [PATCH] v2v: -i vmx: Use scp -T option if available to unbreak scp
|
|
|
c1122e |
(RHBZ#1733168).
|
|
|
c1122e |
|
|
|
c1122e |
Tested using:
|
|
|
c1122e |
|
|
|
c1122e |
cd v2v
|
|
|
c1122e |
LIBGUESTFS_BACKEND=direct ../run virt-v2v -i vmx -it ssh "ssh://localhost/$PWD/test-v2v-i-vmx-1.vmx" -o null -v -x
|
|
|
c1122e |
|
|
|
c1122e |
and manually examining the debug output.
|
|
|
c1122e |
|
|
|
c1122e |
Thanks: Ming Xie, Jakub Jelen.
|
|
|
c1122e |
(cherry picked from commit 7692c31494f7b1d37e380eed9eb99c5952940dbf)
|
|
|
c1122e |
---
|
|
|
c1122e |
v2v/input_vmx.ml | 8 +++++++-
|
|
|
c1122e |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
c1122e |
|
|
|
c1122e |
diff --git a/v2v/input_vmx.ml b/v2v/input_vmx.ml
|
|
|
3efd08 |
index b169b2537..e3469308d 100644
|
|
|
c1122e |
--- a/v2v/input_vmx.ml
|
|
|
c1122e |
+++ b/v2v/input_vmx.ml
|
|
|
c1122e |
@@ -61,6 +61,11 @@ let server_of_uri { Xml.uri_server } =
|
|
|
c1122e |
let path_of_uri { Xml.uri_path } =
|
|
|
c1122e |
match uri_path with None -> assert false | Some p -> p
|
|
|
c1122e |
|
|
|
c1122e |
+let scp_supports_T_option = lazy (
|
|
|
c1122e |
+ let cmd = "LANG=C scp -T |& grep \"unknown option\"" in
|
|
|
c1122e |
+ shell_command cmd <> 0
|
|
|
c1122e |
+)
|
|
|
c1122e |
+
|
|
|
c1122e |
(* 'scp' a remote file into a temporary local file, returning the path
|
|
|
c1122e |
* of the temporary local file.
|
|
|
c1122e |
*)
|
|
|
c1122e |
@@ -68,8 +73,9 @@ let scp_from_remote_to_temporary uri tmpdir filename =
|
|
|
c1122e |
let localfile = tmpdir // filename in
|
|
|
c1122e |
|
|
|
c1122e |
let cmd =
|
|
|
c1122e |
- sprintf "scp%s%s %s%s:%s %s"
|
|
|
c1122e |
+ sprintf "scp%s%s%s %s%s:%s %s"
|
|
|
c1122e |
(if verbose () then "" else " -q")
|
|
|
c1122e |
+ (if Lazy.force scp_supports_T_option then " -T" else "")
|
|
|
c1122e |
(match port_of_uri uri with
|
|
|
c1122e |
| None -> ""
|
|
|
c1122e |
| Some port -> sprintf " -P %d" port)
|
|
|
c1122e |
--
|
|
|
da373f |
2.18.4
|
|
|
c1122e |
|