qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.7] char: fix waiting for TLS and telnet co


From: Dennis Luehring
Subject: Re: [Qemu-devel] [PATCH for-2.7] char: fix waiting for TLS and telnet connection
Date: Tue, 16 Aug 2016 11:19:02 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

you should push that change - can't find it on http://git.qemu.org/qemu.git

Am 16.08.2016 um 10:33 schrieb Marc-André Lureau:
Since commit d7a04fd7d5008, tcp_chr_wait_connected() was introduced,
so vhost-user could wait until a backend started successfully. In
vhost-user case, the chr socket must be plain unix, and the chr+vhost
setup happens synchronously during qemu startup.

However, with TLS and telnet socket, initial socket setup happens
asynchronously, and s->connected is not set after the socket is
accepted. In order for tcp_chr_wait_connected() to not keep accepting
new connections and proceed with the last accepted socket, it can
check for s->ioc instead.

Signed-off-by: Marc-André Lureau <address@hidden>
---
  qemu-char.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qemu-char.c b/qemu-char.c
index 8a0ab05..5f82ebb 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3176,7 +3176,9 @@ static int tcp_chr_wait_connected(CharDriverState *chr, 
Error **errp)
      TCPCharDriver *s = chr->opaque;
      QIOChannelSocket *sioc;
- while (!s->connected) {
+    /* It can't wait on s->connected, since it is set asynchronously
+     * in TLS and telnet cases, only wait for an accepted socket */
+    while (!s->ioc) {
          if (s->is_listen) {
              fprintf(stderr, "QEMU waiting for connection on: %s\n",
                      chr->filename);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]