[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/28] Revert "qemu-char: Keep pty slave file descrip
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 03/28] Revert "qemu-char: Keep pty slave file descriptor open until the master is closed" |
Date: |
Tue, 16 Feb 2016 17:34:21 +0100 |
This reverts commit 34689e206abddac87a5217d458534e24f2a05562.
Marc-André Lureau provided the following commentary: "It looks like if
a the slave is opened, then Linux will buffer the master writes, up to
a few kb and then throttle, so it's not entirely blocked but eventually
the guest VM dies. However, not having any slave open it will simply let
the write go and discard the data. At least, virt-install configures
a pty for the serial but viewers like virt-manager do not necessarily
open it. And, if there are no viewers, it will just hang. If qemu
starts reading all the data from the slave, I don't think interactions
with other slaves will work. I don't see much options but to close the
slave, thus reverting this patch."
Signed-off-by: Paolo Bonzini <address@hidden>
---
qemu-char.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 1b7d5da..00caf65 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1171,7 +1171,6 @@ typedef struct {
int connected;
guint timer_tag;
guint open_tag;
- int slave_fd;
} PtyCharDriver;
static void pty_chr_update_read_handler_locked(CharDriverState *chr);
@@ -1348,7 +1347,6 @@ static void pty_chr_close(struct CharDriverState *chr)
qemu_mutex_lock(&chr->chr_write_lock);
pty_chr_state(chr, 0);
- close(s->slave_fd);
object_unref(OBJECT(s->ioc));
if (s->timer_tag) {
g_source_remove(s->timer_tag);
@@ -1376,6 +1374,7 @@ static CharDriverState *qemu_chr_open_pty(const char *id,
return NULL;
}
+ close(slave_fd);
qemu_set_nonblock(master_fd);
chr = qemu_chr_alloc(common, errp);
@@ -1400,7 +1399,6 @@ static CharDriverState *qemu_chr_open_pty(const char *id,
chr->explicit_be_open = true;
s->ioc = QIO_CHANNEL(qio_channel_file_new_fd(master_fd));
- s->slave_fd = slave_fd;
s->timer_tag = 0;
return chr;
--
2.5.0
- [Qemu-devel] [PULL 00/28] Bug fixes + NBD-over-TLS support patches for 2016-02-16, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 01/28] checkpatch: Eliminate false positive in case of comma-space-square bracket, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 02/28] checkpatch: Eliminate false positive in case of space before square bracket in a definition, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 03/28] Revert "qemu-char: Keep pty slave file descriptor open until the master is closed",
Paolo Bonzini <=
- [Qemu-devel] [PULL 04/28] char: fix handling of QIO_CHANNEL_ERR_BLOCK, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 05/28] build: Don't redefine 'inline', Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 06/28] vl: change QEMU state machine for system reset, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 08/28] migration: fix incorrect memory_global_dirty_log_start outside BQL, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 07/28] vl: fix migration from prelaunch state, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 12/28] ipmi: sensor number should not exceed MAX_SENSORS, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 10/28] mptsas: fix memory leak, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 11/28] mptsas: fix wrong formula, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 09/28] mptsas: add missing va_end, Paolo Bonzini, 2016/02/16
- [Qemu-devel] [PULL 14/28] qemu-nbd: add support for --object command line arg, Paolo Bonzini, 2016/02/16