]> git.proxmox.com Git - mirror_qemu.git/commit
char: remove the right fd been watched in qemu_chr_fe_set_handlers()
authorzhanghailiang <zhang.zhanghailiang@huawei.com>
Fri, 17 Feb 2017 02:53:13 +0000 (10:53 +0800)
committerJason Wang <jasowang@redhat.com>
Mon, 6 Mar 2017 03:46:02 +0000 (11:46 +0800)
commit8487ce45f890cab208541f01e79579d7b25e1615
tree0013e431aa3a34e0da0e3a9c5eb898e11314d619
parentdfd917a9c2bed578c31043126c9f558190bf21e4
char: remove the right fd been watched in qemu_chr_fe_set_handlers()

We can call qemu_chr_fe_set_handlers() to add/remove fd been watched
in 'context' which can be either default main context or other explicit
context. But the original logic is not correct, we didn't remove
the right fd because we call g_main_context_find_source_by_id(NULL, tag)
which always try to find the Gsource from default context.

Fix it by passing the right context to g_main_context_find_source_by_id().

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
chardev/char-fd.c
chardev/char-io.c
chardev/char-io.h
chardev/char-pty.c
chardev/char-socket.c
chardev/char-udp.c
chardev/char.c