[Libguestfs] [PATCH] v2v: -o libvirt: dump XML for libvirt if verbose

Pino Toscano ptoscano at redhat.com
Thu Oct 22 12:40:49 UTC 2015


When running in verbose mode, dump the XML we created for libvirt:
this way it is easier to debug mismatches between what we want to setup
in libvirt, and what actually gets defined.
---
 v2v/output_libvirt.ml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/v2v/output_libvirt.ml b/v2v/output_libvirt.ml
index abdd410..f86f336 100644
--- a/v2v/output_libvirt.ml
+++ b/v2v/output_libvirt.ml
@@ -407,6 +407,12 @@ class output_libvirt oc output_pool = object
     DOM.doc_to_chan chan doc;
     close_out chan;
 
+    if verbose () then (
+      printf "resulting XML for libvirt:\n%!";
+      DOM.doc_to_chan stdout doc;
+      printf "\n%!";
+    );
+
     (* Define the domain in libvirt. *)
     let cmd =
       match oc with
-- 
2.1.0




More information about the Libguestfs mailing list