Skip to contentSkip to conversation

migration: Fix colo hang in socket_accept_incoming_migration

PATCH In review Guang Wang 2 participants 2 messages Mar 27, 2017

lore
Share & tools
lore

Guang Wang

author
#0 lore raw

PATCH v2 1/1 migration: Fix colo hang in socket_accept_incoming_migration

From: Wang guang <[email protected]>

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.

---
 io/channel-socket.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
io/channel-socket.c +1 -7
index f546c68..64b36f5 100644
@@ -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,
Signature · 1 line
1.8.3.1
#1 lore raw

Hi,

It seems that there is no difference from your previous version.
You don't have to re-send it if there are no changes.
This patch has been reviewed, so you can just wait until maintainers process it :)

Thanks.

Quoted 37 lines · Guang Wang

From: Wang guang <[email protected]>

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.

---
  io/channel-socket.c | 8 +-------
  1 file changed, 1 insertion(+), 7 deletions(-)
io/channel-socket.c +1 -7
index f546c68..64b36f5 100644
@@ -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,