]> git.ipfire.org Git - thirdparty/qemu.git/commit
Fix address handling in inet_nonblocking_connect
authorOrit Wasserman <owasserm@redhat.com>
Mon, 24 Sep 2012 11:11:09 +0000 (13:11 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 12 Oct 2012 02:44:21 +0000 (21:44 -0500)
commit240f68ce5b9bdd13f859c80f286332036de33e6b
tree3b408552027bd428157b93194b97901f2be3b5d2
parentee0999b16af3cfd874a1bd9a0cfe3f60426878cf
Fix address handling in inet_nonblocking_connect

getaddrinfo can give us a list of addresses, but we only try to
connect to the first one. If that fails we never proceed to
the next one.  This is common on desktop setups that often have ipv6
configured but not actually working.

To fix this make inet_connect_nonblocking retry connection with a different
address.
callers on inet_nonblocking_connect register a callback function that will
be called when connect opertion completes, in case of failure the fd will have
a negative value

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 233aa5c2d1cf4655ffe335025a68cf5454f87dad)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
migration-tcp.c
qemu-char.c
qemu-sockets.c
qemu_socket.h