qio: introduce qio_channel_add_watch_{full|source}
commit315409c7115b9f6b1b027899c214f4a1f706a7c5
authorPeter Xu <peterx@redhat.com>
Mon, 5 Mar 2018 06:43:20 +0000 (5 14:43 +0800)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 6 Mar 2018 10:19:04 +0000 (6 10:19 +0000)
tree15a082834c690ebaf7d10a58ddcad8d34716c3d2
parent7c28768fef4bbd7601b26c4efca4ced9c0651356
qio: introduce qio_channel_add_watch_{full|source}

Firstly, introduce an internal qio_channel_add_watch_full(), which
enhances qio_channel_add_watch() that context can be specified.

Then add a new API wrapper qio_channel_add_watch_source() to return a
GSource pointer rather than a tag ID.

Note that the _source() call will keep a reference of GSource so that
callers need to unref them explicitly when finished using the GSource.

Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
include/io/channel.h
io/channel.c