diff mbox

[v2] migration: Fix colo hang in socket_accept_incoming_migration

Message ID 1490317489-3544-1-git-send-email-wang.guang55@zte.com.cn
State New
Headers show

Commit Message

Wang Guang March 24, 2017, 1:04 a.m. UTC
From: Wang guang <wang.guang55@zte.com.cn>

The channel socket was initialized manually, 
but forgot to set QIO_CHANNEL_FEATURE_SHUTDOWN.
Thus, the colo_process_incoming_thread would hang at recvmsg.
This patch just call qio_channel_socket_new to get channel,
Which set QIO_CHANNEL_FEATURE_SHUTDOWN already.

Signed-off-by: Wang Guang<wang.guang55@zte.com.cn>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 io/channel-socket.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Daniel P. Berrangé April 3, 2017, 11:04 a.m. UTC | #1
On Fri, Mar 24, 2017 at 09:04:49AM +0800, Guang Wang wrote:
> From: Wang guang <wang.guang55@zte.com.cn>
> 
> The channel socket was initialized manually, 
> but forgot to set QIO_CHANNEL_FEATURE_SHUTDOWN.
> Thus, the colo_process_incoming_thread would hang at recvmsg.
> This patch just call qio_channel_socket_new to get channel,
> Which set QIO_CHANNEL_FEATURE_SHUTDOWN already.
> 
> Signed-off-by: Wang Guang<wang.guang55@zte.com.cn>
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> ---
>  io/channel-socket.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)

Looks good to me - I'll try to get this into 2.9


Regards,
Daniel
diff mbox

Patch

diff --git a/io/channel-socket.c b/io/channel-socket.c
index f546c68..64b36f5 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -331,16 +331,10 @@  qio_channel_socket_accept(QIOChannelSocket *ioc,
 {
     QIOChannelSocket *cioc;
 
-    cioc = QIO_CHANNEL_SOCKET(object_new(TYPE_QIO_CHANNEL_SOCKET));
-    cioc->fd = -1;
+    cioc = qio_channel_socket_new();
     cioc->remoteAddrLen = sizeof(ioc->remoteAddr);
     cioc->localAddrLen = sizeof(ioc->localAddr);
 
-#ifdef WIN32
-    QIO_CHANNEL(cioc)->event = CreateEvent(NULL, FALSE, FALSE, NULL);
-#endif
-
-
  retry:
     trace_qio_channel_socket_accept(ioc);
     cioc->fd = qemu_accept(ioc->fd, (struct sockaddr *)&cioc->remoteAddr,