[libvirt] [PATCH 2/4] xenconfig: format spice listenAddr when formating ports

Jim Fehlig jfehlig at suse.com
Fri May 8 22:00:42 UTC 2015


Move formating of spice listenAddr to the section of code
where spice ports are formatted.  It is more logical to
format address and ports together.  Account for the change
in spice cfg test file by moving 'spicehost'.

Signed-off-by: Jim Fehlig <jfehlig at suse.com>
---
 src/xenconfig/xen_xl.c            | 10 +++++-----
 tests/xlconfigdata/test-spice.cfg |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index bfd6d6b..7f3cd89 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -683,6 +683,11 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
             if (xenConfigSetInt(conf, "spice", 1) < 0)
                 return -1;
 
+            listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
+            if (listenAddr &&
+                xenConfigSetString(conf, "spicehost", listenAddr) < 0)
+                return -1;
+
             if (xenConfigSetInt(conf, "spiceport",
                                 graphics->data.spice.port) < 0)
                 return -1;
@@ -701,11 +706,6 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def)
                     return -1;
             }
 
-            listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
-            if (listenAddr &&
-                xenConfigSetString(conf, "spicehost", listenAddr) < 0)
-                return -1;
-
             if (xenConfigSetInt(conf, "spiceagent_mouse",
                                 graphics->data.spice.mousemode) < 0)
                 return -1;
diff --git a/tests/xlconfigdata/test-spice.cfg b/tests/xlconfigdata/test-spice.cfg
index 21f0e55..b2b9742 100644
--- a/tests/xlconfigdata/test-spice.cfg
+++ b/tests/xlconfigdata/test-spice.cfg
@@ -22,9 +22,9 @@ disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,
 sdl = 0
 vnc = 0
 spice = 1
+spicehost = "127.0.0.1"
 spiceport = 590
 spicetls_port = 500
 spicedisable_ticketing = 1
 spicepasswd = "thebeast"
-spicehost = "127.0.0.1"
 spiceagent_mouse = 0
-- 
1.8.4.5




More information about the libvir-list mailing list