Skip to contentSkip to conversation

Exclude unix: from vnc call to unix_listen()

PATCH Applied Ryan Harper 2 participants 2 messages Dec 1, 2008 – Dec 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Exclude unix: from vnc call to unix_listen()

When using an existing unix socket 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. The fix is to not pass in unix: for the filename (same way qemu-char.c does it).

Signature · 16 lines
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
[email protected]


---
When using an existing unix socket 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.  The fix is to not pass
in unix: for the filename (same way qemu-char.c does it).

Signed-off-by: Ryan Harper <[email protected]>
vnc.c +1 -1
index f663b38..c0e591c 100644
@@ -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);
         }
#1 lore raw
Quoted 8 lines · Ryan Harper

When using an existing unix socket 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. The fix is to not pass in unix: for the filename (same way qemu-char.c does it).

Applied. Thanks.

Regards,

Anthony Liguori