]> Git Repo - qemu.git/commitdiff
migration: let incoming side use thread context
authorPeter Xu <[email protected]>
Wed, 2 May 2018 10:47:17 +0000 (18:47 +0800)
committerJuan Quintela <[email protected]>
Tue, 15 May 2018 18:24:27 +0000 (20:24 +0200)
The old incoming migration is running in main thread and default
gcontext.  With the new qio_channel_add_watch_full() we can now let it
run in the thread's own gcontext (if there is one).

Currently this patch does nothing alone.  But when any of the incoming
migration is run in another iothread (e.g., the upcoming migrate-recover
command), this patch will bind the incoming logic to the iothread
instead of the main thread (which may already get page faulted and
hanged).

RDMA is not considered for now since it's not even using the QIO watch
framework at all.

Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Signed-off-by: Peter Xu <[email protected]>
Message-Id: <20180502104740[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
migration/exec.c
migration/fd.c
migration/socket.c

index 0bc5a427dd6b4913ef8e1e44f07dc002e8d6858a..9d0f82f1f074fc0c4cf6e201fbfdf281805fad2e 100644 (file)
@@ -65,9 +65,8 @@ void exec_start_incoming_migration(const char *command, Error **errp)
     }
 
     qio_channel_set_name(ioc, "migration-exec-incoming");
-    qio_channel_add_watch(ioc,
-                          G_IO_IN,
-                          exec_accept_incoming_migration,
-                          NULL,
-                          NULL);
+    qio_channel_add_watch_full(ioc, G_IO_IN,
+                               exec_accept_incoming_migration,
+                               NULL, NULL,
+                               g_main_context_get_thread_default());
 }
index cd06182d1ea5de77518822b8b1942673265ba629..9a380bbbc4f146bb6992d0e8f2978eb71fbe7d8d 100644 (file)
@@ -66,9 +66,8 @@ void fd_start_incoming_migration(const char *infd, Error **errp)
     }
 
     qio_channel_set_name(QIO_CHANNEL(ioc), "migration-fd-incoming");
-    qio_channel_add_watch(ioc,
-                          G_IO_IN,
-                          fd_accept_incoming_migration,
-                          NULL,
-                          NULL);
+    qio_channel_add_watch_full(ioc, G_IO_IN,
+                               fd_accept_incoming_migration,
+                               NULL, NULL,
+                               g_main_context_get_thread_default());
 }
index 7a5eb562b8166bc325d014c44ed70c59547522f4..3456eb76e9309fca3c587ddf9190beb4efc4f395 100644 (file)
@@ -190,9 +190,10 @@ static void socket_start_incoming_migration(SocketAddress *saddr,
         return;
     }
 
-    qio_net_listener_set_client_func(listener,
-                                     socket_accept_incoming_migration,
-                                     NULL, NULL);
+    qio_net_listener_set_client_func_full(listener,
+                                          socket_accept_incoming_migration,
+                                          NULL, NULL,
+                                          g_main_context_get_thread_default());
 }
 
 void tcp_start_incoming_migration(const char *host_port, Error **errp)
This page took 0.031849 seconds and 4 git commands to generate.