[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 06/15] qio: store gsources for net listeners
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 06/15] qio: store gsources for net listeners |
Date: |
Thu, 1 Mar 2018 18:12:57 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 01/03/2018 09:44, Peter Xu wrote:
> 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 <address@hidden>
> ---
> include/io/net-listener.h | 21 ++++++++++++++--
> io/net-listener.c | 62
> +++++++++++++++++++++++++++++------------------
> 2 files changed, 58 insertions(+), 25 deletions(-)
>
> diff --git a/include/io/net-listener.h b/include/io/net-listener.h
> index 56d6da7a76..566be283b3 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,34 @@ 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
Please add a note like "if %NULL, the default context will be used".
Paolo
- Re: [Qemu-devel] [PATCH v2 03/15] qio: introduce qio_channel_add_watch_{full|source}, (continued)
[Qemu-devel] [PATCH v2 05/15] qio: refactor net listener source operations, Peter Xu, 2018/03/01
[Qemu-devel] [PATCH v2 06/15] qio: store gsources for net listeners, Peter Xu, 2018/03/01
[Qemu-devel] [PATCH v2 07/15] qio/chardev: update net listener gcontext, Peter Xu, 2018/03/01
[Qemu-devel] [PATCH v2 08/15] chardev: allow telnet gsource to switch gcontext, Peter Xu, 2018/03/01