Currently unused, in a future commit this will allow you to pass in a
password to be used when connecting to the target hypervisor.
---
 v2v/cmdline.ml   | 18 ++++++++++++++++++
 v2v/virt-v2v.pod |  7 +++++++
 2 files changed, 25 insertions(+)

diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
index efad080cc..059804431 100644
--- a/v2v/cmdline.ml
+++ b/v2v/cmdline.ml
@@ -62,6 +62,7 @@ let parse_cmdline () =
   let output_conn = ref None in
   let output_format = ref None in
   let output_name = ref None in
+  let output_password = ref None in
   let output_storage = ref None in
   let password_file = ref None in
   let vddk_config = ref None in
@@ -214,6 +215,8 @@ let parse_cmdline () =
                                     s_"Set output format";
     [ M"on" ],       Getopt.String ("name", set_string_option_once "-on" 
output_name),
                                     s_"Rename guest when converting";
+    [ M"op" ],       Getopt.String ("filename", set_string_option_once "-op" 
output_password),
+                                    s_"Use password from file to connect to 
output hypervisor";
     [ M"os" ],       Getopt.String ("storage", set_string_option_once "-os" 
output_storage),
                                     s_"Set output storage location";
     [ L"password-file" ], Getopt.String ("file", set_string_option_once 
"--password-file" password_file),
@@ -307,6 +310,7 @@ read the man page virt-v2v(1).
   let output_format = !output_format in
   let output_mode = !output_mode in
   let output_name = !output_name in
+  let output_password = !output_password in
   let output_storage = !output_storage in
   let password_file = !password_file in
   let print_source = !print_source in
@@ -452,6 +456,8 @@ read the man page virt-v2v(1).
     | `Glance ->
       if output_conn <> None then
         error_option_cannot_be_used_in_output_mode "glance" "-oc";
+      if output_password <> None then
+        error_option_cannot_be_used_in_output_mode "glance" "-op";
       if output_storage <> None then
         error_option_cannot_be_used_in_output_mode "glance" "-os";
       if qemu_boot then
@@ -463,6 +469,8 @@ read the man page virt-v2v(1).
 
     | `Not_set
     | `Libvirt ->
+      if output_password <> None then
+        error_option_cannot_be_used_in_output_mode "libvirt" "-op";
       let output_storage = Option.default "default" output_storage in
       if qemu_boot then
         error_option_cannot_be_used_in_output_mode "libvirt" "--qemu-boot";
@@ -472,6 +480,8 @@ read the man page virt-v2v(1).
       output_format, output_alloc
 
     | `Local ->
+      if output_password <> None then
+        error_option_cannot_be_used_in_output_mode "local" "-op";
       let os =
         match output_storage with
         | None ->
@@ -491,6 +501,8 @@ read the man page virt-v2v(1).
         error_option_cannot_be_used_in_output_mode "null" "-oc";
       if output_format <> None then
         error_option_cannot_be_used_in_output_mode "null" "-of";
+      if output_password <> None then
+        error_option_cannot_be_used_in_output_mode "null" "-op";
       if output_storage <> None then
         error_option_cannot_be_used_in_output_mode "null" "-os";
       if qemu_boot then
@@ -500,6 +512,8 @@ read the man page virt-v2v(1).
       Some "raw", Sparse
 
     | `QEmu ->
+      if output_password <> None then
+        error_option_cannot_be_used_in_output_mode "qemu" "-op";
       let os =
         match output_storage with
         | None ->
@@ -511,6 +525,8 @@ read the man page virt-v2v(1).
       output_format, output_alloc
 
     | `RHV ->
+      if output_password <> None then
+        error_option_cannot_be_used_in_output_mode "rhv" "-op";
       let os =
         match output_storage with
         | None ->
@@ -522,6 +538,8 @@ read the man page virt-v2v(1).
       output_format, output_alloc
 
     | `VDSM ->
+      if output_password <> None then
+        error_option_cannot_be_used_in_output_mode "vdsm" "-op";
       let os =
         match output_storage with
         | None ->
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
index 4179245d6..4e75995d0 100644
--- a/v2v/virt-v2v.pod
+++ b/v2v/virt-v2v.pod
@@ -569,6 +569,13 @@ If not specified, then the input format is used.
 Rename the guest when converting it.  If this option is not used then
 the output name is the same as the input name.
 
+=item B<-op> file
+
+Supply a file containing a password to be used when connecting to the
+target hypervisor.  Note the file should contain the whole password,
+B<without any trailing newline>, and for security the file should have
+mode C<0600> so that others cannot read it.
+
 =item B<-os> storage
 
 The location of the storage for the converted guest.
-- 
2.13.2

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to