[PATCH] v2v: convert old-style libvirt listen configuration (RHBZ#1174073)
Use the listen configuration from the "listen" attribute of <graphics>, in case <listen> is missing. Followup of commit 9360675dc244a8762e07a8a4289e7a30ca3e1eef. --- v2v/input_libvirtxml.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml index 8400779..dd46ee2 100644 --- a/v2v/input_libvirtxml.ml +++ b/v2v/input_libvirtxml.ml @@ -98,8 +98,9 @@ let parse_libvirt_xml ?conn ~verbose xml = let listen = let obj = Xml.xpath_eval_expression xpathctx "listen" in let nr_nodes = Xml.xpathobj_nr_nodes obj in - if nr_nodes < 1 then LNone - else ( + if nr_nodes < 1 then ( + match xpath_to_string "@listen" "" with "" -> LNone | a -> LAddress a + ) else ( (* Use only the first <listen> configuration. *) match xpath_to_string "listen[1]/@type" "" with | "" -> LNone -- 2.1.0
On Mon, Apr 27, 2015 at 10:29:10AM +0200, Pino Toscano wrote:
Use the listen configuration from the "listen" attribute of <graphics>, in case <listen> is missing.
Followup of commit 9360675dc244a8762e07a8a4289e7a30ca3e1eef. --- v2v/input_libvirtxml.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml index 8400779..dd46ee2 100644 --- a/v2v/input_libvirtxml.ml +++ b/v2v/input_libvirtxml.ml @@ -98,8 +98,9 @@ let parse_libvirt_xml ?conn ~verbose xml = let listen = let obj = Xml.xpath_eval_expression xpathctx "listen" in let nr_nodes = Xml.xpathobj_nr_nodes obj in - if nr_nodes < 1 then LNone - else ( + if nr_nodes < 1 then ( + match xpath_to_string "@listen" "" with "" -> LNone | a -> LAddress a + ) else ( (* Use only the first <listen> configuration. *) match xpath_to_string "listen[1]/@type" "" with | "" -> LNone
ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
participants (2)
-
Pino Toscano -
Richard W.M. Jones