[Top][All Lists]

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

[Qemu-devel] [PULL 07/23] char: drop data written to a disconnected pty

From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 07/23] char: drop data written to a disconnected pty
Date: Thu, 16 Feb 2017 15:31:31 +0100

From: Ed Swierk <address@hidden>

When a serial port writes data to a pty that's disconnected, drop the
data and return the length dropped. This avoids triggering pointless
retries in callers like the 16550A serial_xmit(), and causes
qemu_chr_fe_write() to write all data to the log file, rather than
logging only while a pty client like virsh console happens to be

Signed-off-by: Ed Swierk <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
 chardev/char-pty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chardev/char-pty.c b/chardev/char-pty.c
index 27eb85f..ecf2c7a 100644
--- a/chardev/char-pty.c
+++ b/chardev/char-pty.c
@@ -129,7 +129,7 @@ static int char_pty_chr_write(Chardev *chr, const uint8_t 
*buf, int len)
         /* guest sends data, check for (re-)connect */
         if (!s->connected) {
-            return 0;
+            return len;
     return io_channel_send(s->ioc, buf, len);

reply via email to

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