[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 25/28] io: let watcher of the channel run in same
From: |
Peter Xu |
Subject: |
[Qemu-devel] [PATCH v5 25/28] io: let watcher of the channel run in same ctx |
Date: |
Tue, 5 Dec 2017 14:53:04 +0800 |
Per-thread gcontext is only used in IOThread (please refer to callers of
g_main_context_push_thread_default), so this patch only affects anything
that will be run in an IOThread. It lets the watcher object be run in
the same context as the caller that added the watcher.
This patch is critical to make sure that migration stream accept()
procedure will also be run in the monitor IOThread rather than the
default main thread, so it can survive even if main thread hangs.
Signed-off-by: Peter Xu <address@hidden>
---
io/channel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io/channel.c b/io/channel.c
index ec4b86de7c..d6018ddfb6 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -312,7 +312,7 @@ guint qio_channel_add_watch(QIOChannel *ioc,
g_source_set_callback(source, (GSourceFunc)func, user_data, notify);
- id = g_source_attach(source, NULL);
+ id = g_source_attach(source, g_main_context_get_thread_default());
g_source_unref(source);
return id;
--
2.14.3
- [Qemu-devel] [PATCH v5 15/28] migration: new cmd MIG_CMD_RECV_BITMAP, (continued)
- [Qemu-devel] [PATCH v5 15/28] migration: new cmd MIG_CMD_RECV_BITMAP, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 16/28] migration: new message MIG_RP_MSG_RECV_BITMAP, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 17/28] migration: new cmd MIG_CMD_POSTCOPY_RESUME, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 18/28] migration: new message MIG_RP_MSG_RESUME_ACK, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 19/28] migration: introduce SaveVMHandlers.resume_prepare, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 20/28] migration: synchronize dirty bitmap for resume, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 22/28] migration: final handshake for the resume, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 21/28] migration: setup ramstate for resume, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 23/28] migration: free SocketAddress where allocated, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 24/28] migration: init dst in migration_object_init too, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 25/28] io: let watcher of the channel run in same ctx,
Peter Xu <=
- [Qemu-devel] [PATCH v5 26/28] migration: allow migrate_cancel to pause postcopy, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 27/28] qmp/migration: new command migrate-recover, Peter Xu, 2017/12/05
- [Qemu-devel] [PATCH v5 28/28] hmp/migration: add migrate_recover command, Peter Xu, 2017/12/05
- Re: [Qemu-devel] [PATCH v5 00/28] Migration: postcopy failure recovery, Peter Xu, 2017/12/05
- Re: [Qemu-devel] [PATCH v5 00/28] Migration: postcopy failure recovery, Dr. David Alan Gilbert, 2017/12/05