On Fri, Jan 17, 2020 at 05:09:20PM +0100, Pino Toscano wrote:
No need to read the whole OVF file in memory and parse that -- let
libxml2 parse it directly.
---
v2v/parse_ovf_from_ova.ml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/v2v/parse_ovf_from_ova.ml b/v2v/parse_ovf_from_ova.ml
index 27761d23..5acf7070 100644
--- a/v2v/parse_ovf_from_ova.ml
+++ b/v2v/parse_ovf_from_ova.ml
@@ -36,8 +36,7 @@ type ovf_disk = {
}
let xpathctx_of_ovf ovf_filename =
- let xml = read_whole_file ovf_filename in
- let doc = Xml.parse_memory xml in
+ let doc = Xml.parse_file ovf_filename in
(* Handle namespaces. *)
let xpathctx = Xml.xpath_new_context doc in
Obvious fix, ACK, thanks.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html