summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qemu-char.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 8a0ab05a7b..5f82ebb774 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);