[Libvir] [PATCH] Can specify VNC port number 5900

Nobuhiro Itou fj0873gn at aa.jp.fujitsu.com
Thu Mar 8 07:10:48 UTC 2007


Hi

The libvirt cannot specify VNC port number 5900.
Currently if we specify the port 5900,
The port number set to 5900+DomID.

This patch fixes the port number from 5900+DomID to 5900
for this case.


Signed-off-by: Nobuhiro Itou <fj0873gn at aa.jp.fujitsu.com>

Thanks,
Nobuhiro Itou.


Index: xml.c
===================================================================
RCS file: /data/cvs/libvirt/src/xml.c,v
retrieving revision 1.62
diff -u -p -r1.62 xml.c
--- xml.c       6 Mar 2007 20:00:17 -0000       1.62
+++ xml.c       8 Mar 2007 04:23:03 -0000
@@ -251,7 +251,7 @@ static int virDomainParseXMLGraphicsDesc
                     long port = strtol((const char *)vncport, NULL, 10);
                     if (port == -1)
                         virBufferAdd(buf, "(vncunused 1)", 13);
-                    else if (port > 5900)
+                    else if (port >= 5900)
                         virBufferVSprintf(buf, "(vncdisplay %d)", port - 5900);
                     xmlFree(vncport);
                 }
@@ -315,7 +315,7 @@ static int virDomainParseXMLGraphicsDesc
                 long port = strtol((const char *)vncport, NULL, 10);
                 if (port == -1)
                     virBufferAdd(buf, "(vncunused 1)", 13);
-                else if (port > 5900)
+                else if (port >= 5900)
                     virBufferVSprintf(buf, "(vncdisplay %d)", port - 5900);
                 xmlFree(vncport);
             }




More information about the libvir-list mailing list