From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L5Tl6-0007Ls-W9 for qemu-devel@nongnu.org; Wed, 26 Nov 2008 18:25:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L5Tl4-0007Iw-Hq for qemu-devel@nongnu.org; Wed, 26 Nov 2008 18:25:24 -0500 Received: from [199.232.76.173] (port=43700 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L5Tl4-0007Ii-8B for qemu-devel@nongnu.org; Wed, 26 Nov 2008 18:25:22 -0500 Received: from e5.ny.us.ibm.com ([32.97.182.145]:49097) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L5Tl4-0006m2-2z for qemu-devel@nongnu.org; Wed, 26 Nov 2008 18:25:22 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e5.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id mAQNP5H4014972 for ; Wed, 26 Nov 2008 18:25:05 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mAQNPJJY189378 for ; Wed, 26 Nov 2008 18:25:19 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mAQNPJj9002497 for ; Wed, 26 Nov 2008 18:25:19 -0500 Date: Wed, 26 Nov 2008 17:25:17 -0600 From: Ryan Harper Subject: Re: [Qemu-devel] [PATCH 2/3] sockets: switch vnc to new code, support vnc port auto-allocation. Message-ID: <20081126232517.GQ31893@us.ibm.com> References: <1225730550-31941-1-git-send-email-kraxel@redhat.com> <1225730550-31941-3-git-send-email-kraxel@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1225730550-31941-3-git-send-email-kraxel@redhat.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann * Gerd Hoffmann [2008-11-03 10:57]: > This patch switches the vnc code ofer to the new socket helper > functions. > > It adds support IPv6 support and for automatically allocating an unused > vnc display port. The latter is handled ising a to= option, specifying > the upper limit for the display number to try. Scanning is started at > the display number given in the display specification, i.e. this command > line: > > -vnc localhost:7,to=11 > > will try displays 7 to 11 (inclusive). > > There are also new "ipv4" and "ipv6" options to make qemu try only > the specified internet protocol version. > > The display actually allocated can be queried using the "info vnc" > monitor command. When using an existing unix file like: -vnc unix:/tmp/file1Y2nY2 qemu fails to bind a unix socket because the vnc call to unix_listen includes the unix: prefix, and stores that in the unix.sun_path. Like the qemu-char handler, don't pass in unix: for the filename. This fixes -vnc unix: for me. Haven't tested all cases of -vnc, so, double check that this is the right fix. -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx ryanh@us.ibm.com diffstat output: vnc.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Signed-off-by: Ryan Harper --- diff --git a/vnc.c b/vnc.c index f663b38..c0e591c 100644 --- a/vnc.c +++ b/vnc.c @@ -2413,7 +2413,7 @@ int vnc_display_open(DisplayState *ds, const char *display) dpy = qemu_malloc(256); if (strncmp(display, "unix:", 5) == 0) { strcpy(dpy, "unix:"); - vs->lsock = unix_listen(display, dpy+5, 256-5); + vs->lsock = unix_listen(display+5, dpy+5, 256-5); } else { vs->lsock = inet_listen(display, dpy, 256, SOCK_STREAM, 5900); }