[Libguestfs] [PATCH] v2v: Fix parsing of OVA files and documentation for --network and --bridge (RHBZ#1559027).

Pino Toscano ptoscano at redhat.com
Fri Mar 23 09:40:42 UTC 2018


On Thursday, 22 March 2018 17:05:27 CET Richard W.M. Jones wrote:
> When parsing OVA files we have to work backwards to whether the
> original VMware object was a network or a bridge.  It seems as if the
> presence of <rasd:Connection> is sufficient.  I dropped the use of
> <rasd:ElementName> since it is literally just an internal name for the
> network element, and is not significant in how the network is used.
> 
> Also update documentation because you must use ‘--bridge’ when
> converting VMware guests to RHV.
> 
> For a full explanation see:
> 
>   https://bugzilla.redhat.com/show_bug.cgi?id=1559027#c2
> ---

Please update the .expected files in the test suite, since the output
of --print-source changed for some:

FAIL: test-v2v-i-ova-gz.sh
FAIL: test-v2v-i-ova-formats.sh
FAIL: test-v2v-i-ova-subfolders.sh
FAIL: test-v2v-i-ova-tar.sh
FAIL: test-v2v-i-ova-two-disks.sh
FAIL: test-v2v-i-ova.sh

> diff --git a/v2v/parse_ovf_from_ova.ml b/v2v/parse_ovf_from_ova.ml
> index d8de0cea1..82d7adf8c 100644
> --- a/v2v/parse_ovf_from_ova.ml
> +++ b/v2v/parse_ovf_from_ova.ml
> @@ -230,16 +230,17 @@ let parse_ovf_from_ova ovf_filename =
>      for i = 0 to nr_nodes-1 do
>        let n = Xml.xpathobj_node obj i in
>        Xml.xpathctx_set_current_context xpathctx n;
> -      let vnet =
> -        Option.default (sprintf"eth%d" i)
> -                       (xpath_string "rasd:ElementName/text()") in
> +      let vnet, vnet_type =
> +        match xpath_string "rasd:Connection/text()" with
> +        | Some connection -> connection, Bridge
> +        | None -> sprintf"eth%d" i, Network in

Missing space here          ^
(Yes, it is missing in the current code too, but since it is shuffled
by your patch...)

The rest of the patch LGTM.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20180323/b438969a/attachment.sig>


More information about the Libguestfs mailing list