Blame SOURCES/0155-v2v-convert-old-style-libvirt-listen-configuration-R.patch

ffd6ed
From dde05b72c37686b27380d33f88e6a4adc6a5b4a1 Mon Sep 17 00:00:00 2001
ffd6ed
From: Pino Toscano <ptoscano@redhat.com>
ffd6ed
Date: Mon, 27 Apr 2015 10:16:40 +0200
ffd6ed
Subject: [PATCH] v2v: convert old-style libvirt listen configuration
ffd6ed
 (RHBZ#1174073)
ffd6ed
ffd6ed
Use the listen configuration from the "listen" attribute of <graphics>,
ffd6ed
in case <listen> is missing.
ffd6ed
ffd6ed
Followup of commit 9360675dc244a8762e07a8a4289e7a30ca3e1eef.
ffd6ed
ffd6ed
(cherry picked from commit 8c26ef91f95a9de68cea4c2341e00c938586f950)
ffd6ed
---
ffd6ed
 v2v/input_libvirtxml.ml | 5 +++--
ffd6ed
 1 file changed, 3 insertions(+), 2 deletions(-)
ffd6ed
ffd6ed
diff --git a/v2v/input_libvirtxml.ml b/v2v/input_libvirtxml.ml
ffd6ed
index 0db0a88..9834313 100644
ffd6ed
--- a/v2v/input_libvirtxml.ml
ffd6ed
+++ b/v2v/input_libvirtxml.ml
ffd6ed
@@ -96,8 +96,9 @@ let parse_libvirt_xml ?conn ~verbose xml =
ffd6ed
       let listen =
ffd6ed
         let obj = Xml.xpath_eval_expression xpathctx "listen" in
ffd6ed
         let nr_nodes = Xml.xpathobj_nr_nodes obj in
ffd6ed
-        if nr_nodes < 1 then LNone
ffd6ed
-        else (
ffd6ed
+        if nr_nodes < 1 then (
ffd6ed
+          match xpath_to_string "@listen" "" with "" -> LNone | a -> LAddress a
ffd6ed
+        ) else (
ffd6ed
           (* Use only the first <listen> configuration. *)
ffd6ed
           match xpath_to_string "listen[1]/@type" "" with
ffd6ed
           | "" -> LNone
ffd6ed
-- 
ffd6ed
1.8.3.1
ffd6ed