diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-03-18 18:00:41 +0000 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 20:01:35 -0600 |
commit | 8f94fc953706315850cb430c3f902de45a85d95d (patch) | |
tree | 074132cc8b008c875360f2eb4d7ac7fba7f193dd /qemu-char.c | |
parent | ddbf330340b2c4ae136a7a947829a7cfeac8b25b (diff) | |
download | hqemu-8f94fc953706315850cb430c3f902de45a85d95d.zip hqemu-8f94fc953706315850cb430c3f902de45a85d95d.tar.gz |
char: ensure all clients are in non-blocking mode
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 <Andrew.Baumann@microsoft.com>
Reported-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1458324041-22709-1-git-send-email-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r-- | qemu-char.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qemu-char.c b/qemu-char.c index 93fd733..b597ee1 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3081,6 +3081,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); } @@ -3112,7 +3114,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; |