From e89f5ff2c305a335dd42091ab379f1e38df6f161 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Wed, 2 May 2018 18:47:17 +0800 Subject: migration: let incoming side use thread context 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 Reviewed-by: Juan Quintela Signed-off-by: Peter Xu Message-Id: <20180502104740.12123-2-peterx@redhat.com> Signed-off-by: Juan Quintela --- migration/socket.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'migration/socket.c') diff --git a/migration/socket.c b/migration/socket.c index 7a5eb562b8..3456eb76e9 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -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) -- cgit v1.2.3