diff options
author | Peter Xu <peterx@redhat.com> | 2018-03-05 14:43:21 +0800 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2018-03-06 10:19:05 +0000 |
commit | 938c8b79e5249d41469151e30268cfaf88bdb588 (patch) | |
tree | 53488c9335157a7d4c37530157f16154e95dc600 /include | |
parent | 315409c7115b9f6b1b027899c214f4a1f706a7c5 (diff) | |
download | qemu-938c8b79e5249d41469151e30268cfaf88bdb588.zip qemu-938c8b79e5249d41469151e30268cfaf88bdb588.tar.gz qemu-938c8b79e5249d41469151e30268cfaf88bdb588.tar.bz2 |
qio: store gsources for net listeners
Originally we were storing the GSources tag IDs. That'll be not enough
if we are going to support non-default gcontext for QIO code. Switch to
GSources without changing anything real. Now we still always pass in
NULL, which means the default gcontext.
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/io/net-listener.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/include/io/net-listener.h b/include/io/net-listener.h index 56d6da7..8081ac5 100644 --- a/include/io/net-listener.h +++ b/include/io/net-listener.h @@ -53,7 +53,7 @@ struct QIONetListener { char *name; QIOChannelSocket **sioc; - gulong *io_tag; + GSource **io_source; size_t nsioc; bool connected; @@ -120,17 +120,35 @@ void qio_net_listener_add(QIONetListener *listener, QIOChannelSocket *sioc); /** - * qio_net_listener_set_client_func: + * qio_net_listener_set_client_func_full: * @listener: the network listener object * @func: the callback function * @data: opaque data to pass to @func * @notify: callback to free @data + * @context: the context that the sources will be bound to. If %NULL, + * the default context will be used. * * Register @func to be invoked whenever a new client * connects to the listener. @func will be invoked * passing in the QIOChannelSocket instance for the * client. */ +void qio_net_listener_set_client_func_full(QIONetListener *listener, + QIONetListenerClientFunc func, + gpointer data, + GDestroyNotify notify, + GMainContext *context); + +/** + * qio_net_listener_set_client_func: + * @listener: the network listener object + * @func: the callback function + * @data: opaque data to pass to @func + * @notify: callback to free @data + * + * Wrapper of qio_net_listener_set_client_func_full(), only that the + * sources will always be bound to default main context. + */ void qio_net_listener_set_client_func(QIONetListener *listener, QIONetListenerClientFunc func, gpointer data, |