Pino Toscano
2015-Oct-22 12:40 UTC
[Libguestfs] [PATCH] v2v: -o libvirt: dump XML for libvirt if verbose
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
Richard W.M. Jones
2015-Oct-22 15:36 UTC
Re: [Libguestfs] [PATCH] v2v: -o libvirt: dump XML for libvirt if verbose
On Thu, Oct 22, 2015 at 02:40:49PM +0200, Pino Toscano wrote:> 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 withACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Reasonably Related Threads
- [PATCH] v2v: Add support for libosinfo metadata
- [PATCH] v2v: -o libvirt: always write pool names (RHBZ#1141631)
- [PATCH] v2v: make virsh command quiet if v2v is quiet (RHBZ#1358142)
- [PATCH] v2v: -o libvirt: fix <video> element (RHBZ#1225789)
- [v2v PATCH] -o libvirt: read pool name from object