[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Patch to improve handling of server sockets

From: Reinhard Max
Subject: [Qemu-devel] Patch to improve handling of server sockets
Date: Tue, 4 May 2010 15:49:50 +0200 (CEST)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)


I am maintaining the tightvnc package for openSUSE and was recently confronted with an alleged vnc problem with QWMU that turned out to be a shortcoming in QEMU's code for handling TCP server sockets, which is used by the vnc and char modules.

The problem occurs when the address to listen on is given as a name which resolves to multiple IP addresses the most prominent example being "localhost" resolving to and ::1 .

The existing code stopped walking the list of addresses returned by getaddrinfo() as soon as one socket was successfully opened and bound. The result was that a qemu instance started with "-vnc localhost:42" only listened on ::1, wasn't reachable through The fact that the code set the IPV6_V6ONLY socket option didn't help, because that option only works when the socket gets bound to the IPv6 wildcard address (::), but is useless for explicit address bindings.

The attached patch against QEMU 0.11.0 extends inet_listen() to create sockets for as many addresses from the address list as possible and adapts its callers and their data structures to deal with a linked list of socket FDs rather than a single file descriptor.

So far I've only done some testing with the -vnc option. More testing is needed in the qemu-char area and for the parts of the code that get triggered from QEMU's Monitor.

Please review and comment.


P.S. Please keep me in Cc when replying.

Attachment: 0034-qemu-multiple-sockets.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]