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

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@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); }

On Thu, Mar 08, 2007 at 04:10:48PM +0900, Nobuhiro Itou wrote:
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.
As long as (vncdisplay 0) actually works with Xend this looks fine, I assume you tested it so I applied it. I just hope that this also work with older Xen versions. thanks a lot, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Thu, Mar 08, 2007 at 03:56:00AM -0500, Daniel Veillard wrote:
On Thu, Mar 08, 2007 at 04:10:48PM +0900, Nobuhiro Itou wrote:
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.
As long as (vncdisplay 0) actually works with Xend this looks fine, I assume you tested it so I applied it. I just hope that this also work with older Xen versions.
Yeah, it works just fine - dunno how we let that typo slip in there. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Nobuhiro Itou