aboutsummaryrefslogtreecommitdiff
path: root/migration/fd.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-05-02 18:47:17 +0800
committerJuan Quintela <quintela@redhat.com>2018-05-15 20:24:27 +0200
commite89f5ff2c305a335dd42091ab379f1e38df6f161 (patch)
tree5721baf3c96962824f3274f604f8990a6bba1420 /migration/fd.c
parent8c4598f2b1f65ca063d0d5e0dc7f621e2023a0fd (diff)
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 <dgilbert@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180502104740.12123-2-peterx@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/fd.c')
-rw-r--r--migration/fd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/migration/fd.c b/migration/fd.c
index cd06182d1e..9a380bbbc4 100644
--- a/migration/fd.c
+++ b/migration/fd.c
@@ -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());
}