summaryrefslogtreecommitdiffstats
path: root/include/io/net-listener.h
diff options
context:
space:
mode:
authorPeter Maydell2018-03-08 12:26:13 +0100
committerPeter Maydell2018-03-08 12:26:14 +0100
commit3ef91576b96de7051dacc2132cddfb486b46e863 (patch)
tree8ae5b6109272dfc7ae177cb086b2afaaac7bd12b /include/io/net-listener.h
parentMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (diff)
parentqio: non-default context for TLS handshake (diff)
downloadqemu-3ef91576b96de7051dacc2132cddfb486b46e863.tar.gz
qemu-3ef91576b96de7051dacc2132cddfb486b46e863.tar.xz
qemu-3ef91576b96de7051dacc2132cddfb486b46e863.zip
Merge remote-tracking branch 'remotes/berrange/tags/qio-next-pull-request' into staging
# gpg: Signature made Wed 07 Mar 2018 11:24:41 GMT # gpg: using RSA key BE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange/tags/qio-next-pull-request: qio: non-default context for TLS handshake qio: non-default context for async conn qio: non-default context for threaded qtask qio: store gsources for net listeners qio: introduce qio_channel_add_watch_{full|source} qio: rename qio_task_thread_result Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/io/net-listener.h')
-rw-r--r--include/io/net-listener.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/io/net-listener.h b/include/io/net-listener.h
index 56d6da7a76..8081ac58a2 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,