[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] char: ensure all clients are in non-blocking mo
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] char: ensure all clients are in non-blocking mode |
Date: |
Sat, 19 Mar 2016 10:12:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 18/03/2016 19:00, Daniel P. Berrange wrote:
> Only some callers of tcp_chr_new_client are putting the
> socket client into non-blocking mode. Move the call to
> qio_channel_set_blocking() into the tcp_chr_new_client
> method to guarantee that all code paths set non-blocking
> mode
>
> Reported-by: Andrew Baumann <address@hidden>
> Reported-by: Laurent Vivier <address@hidden>
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
> qemu-char.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index bfcf80d..144764e 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -3071,6 +3071,8 @@ static int tcp_chr_new_client(CharDriverState *chr,
> QIOChannelSocket *sioc)
> s->sioc = sioc;
> object_ref(OBJECT(sioc));
>
> + qio_channel_set_blocking(s->ioc, false, NULL);
> +
> if (s->do_nodelay) {
> qio_channel_set_delay(s->ioc, false);
> }
> @@ -3102,7 +3104,6 @@ static int tcp_chr_add_client(CharDriverState *chr, int
> fd)
> if (!sioc) {
> return -1;
> }
> - qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL);
> ret = tcp_chr_new_client(chr, sioc);
> object_unref(OBJECT(sioc));
> return ret;
>
Thanks, queued.
Paolo