On Monday, 21 November 2016 15:29:19 CET Pino Toscano wrote:
On Saturday, 12 November 2016 16:37:50 CET Tomáš Golembiovský wrote:
The information whether the disk is gzip compressed or not is stored in the OVF. There is no reason to do the detection.
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> --- v2v/input_ova.ml | 36 ++++++++++++++++++++---------------- v2v/test-v2v-i-ova-gz.ovf | 2 +- 2 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/v2v/input_ova.ml b/v2v/input_ova.ml index b283629..db884d9 100644 --- a/v2v/input_ova.ml +++ b/v2v/input_ova.ml @@ -275,25 +275,29 @@ object | None -> error (f_"no href in ovf:File (id=%s)") file_ref | Some s -> s in
+ let expr = sprintf "/ovf:Envelope/ovf:References/ovf:File[@ovf:id='%s']/@ovf:compression" file_ref in + let compressed = + match xpath_string expr with + | None | Some "identity" -> false + | Some "gzip" -> true + | Some s -> error (f_"unsupported comprression in OVF: %s") s in
Typo here, "compression".
Also, the two "expr" and "compressed" let could be isolated in the "let filename" block.
Scatch the last bit, since "compressed" seems used also elsewhere, in patch #4. -- Pino Toscano