chardev: allow telnet gsource to switch gcontext
It was originally created by qio_channel_add_watch() so it's always
assigning the task to main context. Now we use the new API called
qio_channel_add_watch_source() so that we get the GSource handle rather
than the tag ID.
Meanwhile, caching the gsource and TCPChardevTelnetInit (which holds the
handshake data) in SocketChardev.telnet_source so that we can also do
dynamic context switch when update read handlers.
Signed-off-by: Peter Xu <[email protected]>
Message-Id: <
20180306053320[email protected]>
Acked-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>