]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
char-pty: remove the check for connection on write
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 6 Feb 2019 17:43:27 +0000 (18:43 +0100)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 13 Feb 2019 15:46:39 +0000 (16:46 +0100)
This doesn't help much compared to the 1 second poll PTY
timer. I can't think of a use case where this would help.

However, we can simplify the code around chr_write(): the write lock
is no longer needed for other char-pty callbacks (see following
patch).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190206174328.9736-6-marcandre.lureau@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
chardev/char-pty.c

index f681d637c1a8d3daa63cee0c1b36f6e92dc58632..f8772c9e15a5ef1d5dca91dd6e6443a4b9970a77 100644 (file)
@@ -130,11 +130,7 @@ static int char_pty_chr_write(Chardev *chr, const uint8_t *buf, int len)
     PtyChardev *s = PTY_CHARDEV(chr);
 
     if (!s->connected) {
-        /* guest sends data, check for (re-)connect */
-        pty_chr_update_read_handler_locked(chr);
-        if (!s->connected) {
-            return len;
-        }
+        return len;
     }
     return io_channel_send(s->ioc, buf, len);
 }