]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
From Charles Duffy:
authorChris Lalancette <clalance@redhat.com>
Thu, 31 Jul 2008 12:30:34 +0000 (12:30 +0000)
committerChris Lalancette <clalance@redhat.com>
Thu, 31 Jul 2008 12:30:34 +0000 (12:30 +0000)
Per subject; if autoport is in use for a host, the current
virDomainGraphicsDefFormat code always emits "port=-1", even if a port
is assigned to the host; this leaves no way for a client to find the VNC
port assigned to the host in question.

This patches fixes it by putting the vncport in place if there is one, and
only putting "-1" if we fail that test.

ChangeLog
src/domain_conf.c

index ce0fc84119e0a5e7474234e9b2a4bcb30fd7fb8b..304c53a7f505d374bb000d257f5d4b29fa72f674 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 31 14:27:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
+
+       * src/domain_conf.c: patch from Charles Duffy to make sure we print
+       the "real" vncport if it exists instead of -1.
+
 Wed Jul 30 11:18:50 CEST 2008 Daniel Veillard <veillard@redhat.com>
 
        * src/qemu_driver.c: patch from Guido Günther, interface stats should
index d62909340b5450de60862e3561b3edd2fce799fd..ece471e75c335de2b400e868329a5e156ec5d4dc 100644 (file)
@@ -2431,11 +2431,11 @@ virDomainGraphicsDefFormat(virConnectPtr conn,
 
     switch (def->type) {
     case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
-        if (def->data.vnc.autoport)
-            virBufferAddLit(buf, " port='-1'");
-        else if (def->data.vnc.port)
+        if (def->data.vnc.port)
             virBufferVSprintf(buf, " port='%d'",
                               def->data.vnc.port);
+        else if (def->data.vnc.autoport)
+            virBufferAddLit(buf, " port='-1'");
 
         virBufferVSprintf(buf, " autoport='%s'",
                           def->data.vnc.autoport ? "yes" : "no");