[Libguestfs] [PATCH] v2v: convert old-style libvirt listen configuration (RHBZ#1174073)

Pino Toscano ptoscano at redhat.com
Mon Apr 27 08:29:10 UTC 2015


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




More information about the Libguestfs mailing list