qemu-e2k/chardev
zhanghailiang b19456dd0e char: Fix removing wrong GSource that be found by fd_in_tag
We use fd_in_tag to find a GSource, fd_in_tag is return value of
g_source_attach(GSource *source, GMainContext *context), the return
value is unique only in the same context, so we may get the same
values with different 'context' parameters.

It is no problem to find the right fd_in_tag by using
 g_main_context_find_source_by_id(GMainContext *context, guint source_id)
while there is only one default main context.

But colo-compare tries to create/use its own context, and if we pass wrong
'context' parameter with right fd_in_tag, we will find a wrong GSource to handle.
We tried to fix the related codes in commit b43decb015,
but it didn't fix the bug completely, because we still have some codes didn't pass
*right* context parameter for remove_fd_in_watch().

Let's fix it by record the GSource directly instead of fd_in_tag.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <1492564532-91680-1-git-send-email-zhang.zhanghailiang@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-05-03 12:29:40 +02:00
..
Makefile.objs char: move parallel chardev in its own file 2017-01-31 23:31:21 +04:00
char-console.c char: move console in its own file 2017-01-31 23:31:21 +04:00
char-fd.c char: Fix removing wrong GSource that be found by fd_in_tag 2017-05-03 12:29:40 +02:00
char-fd.h char: move fd chardev in its own file 2017-01-31 23:31:21 +04:00
char-file.c char: move file chardev in its own file 2017-01-31 23:31:21 +04:00
char-io.c char: Fix removing wrong GSource that be found by fd_in_tag 2017-05-03 12:29:40 +02:00
char-io.h char: Fix removing wrong GSource that be found by fd_in_tag 2017-05-03 12:29:40 +02:00
char-mux.c char: move mux to its own file 2017-01-31 23:31:20 +04:00
char-mux.h char: move mux to its own file 2017-01-31 23:31:20 +04:00
char-null.c char: move null chardev to its own file 2017-01-31 23:31:20 +04:00
char-parallel.c char: move parallel chardev in its own file 2017-01-31 23:31:21 +04:00
char-parallel.h char: move parallel chardev in its own file 2017-01-31 23:31:21 +04:00
char-pipe.c char: move pipe chardev in its own file 2017-01-31 23:31:21 +04:00
char-pty.c char: Fix removing wrong GSource that be found by fd_in_tag 2017-05-03 12:29:40 +02:00
char-ringbuf.c char: move ringbuf/memory to its own file 2017-01-31 23:31:20 +04:00
char-serial.c char: move serial chardev to its own file 2017-01-31 23:31:21 +04:00
char-serial.h char: move serial chardev to its own file 2017-01-31 23:31:21 +04:00
char-socket.c char: Fix removing wrong GSource that be found by fd_in_tag 2017-05-03 12:29:40 +02:00
char-stdio.c char: move stdio in its own file 2017-01-31 23:31:21 +04:00
char-udp.c char: Fix removing wrong GSource that be found by fd_in_tag 2017-05-03 12:29:40 +02:00
char-win-stdio.c char: move win-stdio into its own file 2017-01-31 23:31:21 +04:00
char-win-stdio.h char: move win-stdio into its own file 2017-01-31 23:31:21 +04:00
char-win.c char: move win chardev base class in its own file 2017-01-31 23:31:21 +04:00
char-win.h char: move win chardev base class in its own file 2017-01-31 23:31:21 +04:00
char.c char: Fix removing wrong GSource that be found by fd_in_tag 2017-05-03 12:29:40 +02:00