Pino Toscano
2016-Sep-21 12:33 UTC
[Libguestfs] [PATCH] v2v: -i libvirtxml: ignore <listen type='none'> (RHBZ#1378022)
When reading a libvirt XML which has: <graphics ...> <listen type='none'/> </graphics> then just ignore it, as it is (roughly) the same as no <listen> child elements at all. This avoids a warning about an unknown listen type. --- v2v/input_libvirtxml.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml index 33e878e..1540798 100644 --- a/v2v/input_libvirtxml.ml +++ b/v2v/input_libvirtxml.ml @@ -101,6 +101,7 @@ let parse_libvirt_xml ?conn xml (* Use only the first <listen> configuration. *) match xpath_string "listen[1]/@type" with | None -> LNone + | Some "none" -> LNone | Some "address" -> (match xpath_string "listen[1]/@address" with | None -> LNone -- 2.7.4
Richard W.M. Jones
2016-Sep-21 13:05 UTC
Re: [Libguestfs] [PATCH] v2v: -i libvirtxml: ignore <listen type='none'> (RHBZ#1378022)
On Wed, Sep 21, 2016 at 02:33:23PM +0200, Pino Toscano wrote:> When reading a libvirt XML which has: > > <graphics ...> > <listen type='none'/> > </graphics> > > then just ignore it, as it is (roughly) the same as no <listen> child > elements at all. This avoids a warning about an unknown listen type.I looked at this and don't think it is the same -- see my patch. Rich.> v2v/input_libvirtxml.ml | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml > index 33e878e..1540798 100644 > --- a/v2v/input_libvirtxml.ml > +++ b/v2v/input_libvirtxml.ml > @@ -101,6 +101,7 @@ let parse_libvirt_xml ?conn xml > (* Use only the first <listen> configuration. *) > match xpath_string "listen[1]/@type" with > | None -> LNone > + | Some "none" -> LNone > | Some "address" -> > (match xpath_string "listen[1]/@address" with > | None -> LNone > -- > 2.7.4 > > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Reasonably Related Threads
- [PATCH] v2v: Support <listen type='socket'> and <listen type='none'> (RHBZ#1378022).
- v2v: -i libvirtxml: Map empty network or bridge name to a default (RHBZ#1257895).
- [PATCH] v2v: support no socket for <listen type='socket'>
- [PATCH 1/4] v2v: collect source network and video adapter types
- [PATCH v4 1/5] v2v: collect source network and video adapter types