[Libguestfs] [PATCH] p2v: Allow virt-v2v input and output drivers containing '-' (RHBZ#1590220).

Richard W.M. Jones rjones at redhat.com
Tue Jun 12 09:27:56 UTC 2018


The new ‘-o rhv-upload’ output mode contains a '-' character in the
name, but the regular expression which matched the output of the
virt-v2v command did not recognize '-' as a valid character.  It ended
up mapping this to just "rhv" meaning two "rhv" entries would appear
in the list of output drivers.

Thanks: Ming Xie.
---
 p2v/ssh.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/p2v/ssh.c b/p2v/ssh.c
index d2699fffd..2fcf0ef3e 100644
--- a/p2v/ssh.c
+++ b/p2v/ssh.c
@@ -181,8 +181,8 @@ compile_regexps (void)
 	   0);
   COMPILE (feature_libguestfs_rewrite_re, "libguestfs-rewrite", 0);
   COMPILE (feature_colours_option_re, "colours-option", 0);
-  COMPILE (feature_input_re, "input:((?:\\w)*)", 0);
-  COMPILE (feature_output_re, "output:((?:\\w)*)", 0);
+  COMPILE (feature_input_re, "input:((?:[-\\w])*)", 0);
+  COMPILE (feature_output_re, "output:((?:[-\\w])*)", 0);
   COMPILE (portfwd_re, "Allocated port ((?:\\d)+) for remote forward", 0);
 }
 
-- 
2.16.2




More information about the Libguestfs mailing list