chardev: let g_idle_add() be with chardev gcontext
commit938eb9e9c83d34d90cac6ec5c5388e7998840e4e
authorPeter Xu <peterx@redhat.com>
Thu, 4 Jan 2018 14:18:34 +0000 (4 22:18 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 12 Jan 2018 12:22:02 +0000 (12 13:22 +0100)
tree4b7ebb60d9a17c1b7e46328441b264ee51e100ab
parent91e14fb8e9ee351f01ffe391d7a45cccc3b8da65
chardev: let g_idle_add() be with chardev gcontext

The idle task will be attached to main gcontext even if the chardev
backend is running in another gcontext.  Fix the only caller by
extending the g_idle_add() logic into the more powerful
g_source_attach().  It's basically g_idle_add_full() implementation, but
with the chardev's gcontext passed in.

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180104141835.17987-3-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
chardev/char-pty.c