[Pkg-libvirt-commits] [libguestfs] 43/63: v2v: -i libvirt, -i libvirtxml: Print libvirt XML when debugging.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:43:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.39-1
in repository libguestfs.

commit 54e32eb8e2e10369de4df0ab4481d1fbcf7ecfb9
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Sep 5 14:44:48 2014 +0100

    v2v: -i libvirt, -i libvirtxml: Print libvirt XML when debugging.
---
 v2v/input_libvirt.ml     | 3 ++-
 v2v/input_libvirtxml.ml  | 8 ++++++--
 v2v/input_libvirtxml.mli | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/v2v/input_libvirt.ml b/v2v/input_libvirt.ml
index 9e8e6e7..b7f8376 100644
--- a/v2v/input_libvirt.ml
+++ b/v2v/input_libvirt.ml
@@ -94,7 +94,8 @@ object
             orig_uri;
           None, None in
 
-    Input_libvirtxml.parse_libvirt_xml ?map_source_file ?map_source_dev xml
+    Input_libvirtxml.parse_libvirt_xml ~verbose
+      ?map_source_file ?map_source_dev xml
 end
 
 let input_libvirt = new input_libvirt
diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml
index b9c1a87..1745ec4 100644
--- a/v2v/input_libvirtxml.ml
+++ b/v2v/input_libvirtxml.ml
@@ -28,8 +28,12 @@ type map_source = string -> string option -> string * string option
 
 let no_map : map_source = fun x y -> x, y
 
-let parse_libvirt_xml ?(map_source_file = no_map) ?(map_source_dev = no_map)
+let parse_libvirt_xml ~verbose
+    ?(map_source_file = no_map) ?(map_source_dev = no_map)
     xml =
+  if verbose then
+    printf "libvirt xml is:\n%s\n" xml;
+
   let doc = Xml.parse_memory xml in
   let xpathctx = Xml.xpath_new_context doc in
 
@@ -275,7 +279,7 @@ object
       path, format
     in
 
-    parse_libvirt_xml ~map_source_file xml
+    parse_libvirt_xml ~verbose ~map_source_file xml
 end
 
 let input_libvirtxml = new input_libvirtxml
diff --git a/v2v/input_libvirtxml.mli b/v2v/input_libvirtxml.mli
index f8a69ab..d673150 100644
--- a/v2v/input_libvirtxml.mli
+++ b/v2v/input_libvirtxml.mli
@@ -22,7 +22,7 @@ type map_source = string -> string option -> string * string option
 (** Map function that takes [path] and [format] parameters, and
     returns the possibly rewritten [qemu_uri, format] pair. *)
 
-val parse_libvirt_xml : ?map_source_file:map_source -> ?map_source_dev:map_source -> string -> Types.source
+val parse_libvirt_xml : verbose:bool -> ?map_source_file:map_source -> ?map_source_dev:map_source -> string -> Types.source
 (** Take libvirt XML and parse it into a {!Types.source} structure.
 
     The optional [?map_source_file] and [?map_source_dev] functions

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list