qemu-devel
[Top][All Lists]
Advanced

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

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


From: Anthony Liguori
Subject: Re: [Qemu-devel] Patch to improve handling of server sockets
Date: Tue, 04 May 2010 11:23:17 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 05/04/2010 08:49 AM, Reinhard Max wrote:
Hi,

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 127.0.0.1 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 127.0.0.1. 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.

0.11.0 is pretty old.  Please update your patch against the latest git.

But that said, I'm not sure we're doing the wrong thing right now. Gerd, what do you think about this behavior?

Regards,

Anthony Liguori


Please review and comment.


cu
    Reinhard

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





reply via email to

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