[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/28] char: fix handling of QIO_CHANNEL_ERR_BLOCK
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 04/28] char: fix handling of QIO_CHANNEL_ERR_BLOCK |
Date: |
Tue, 16 Feb 2016 17:34:22 +0100 |
From: "Daniel P. Berrange" <address@hidden>
If io_channel_send_full gets QIO_CHANNEL_ERR_BLOCK it
and has already sent some of the data, it should return
that amount of data, not EAGAIN, as that would cause
the caller to re-try already sent data.
Unfortunately due to a previous rebase conflict resolution
error, the code for dealing with this was in the wrong
part of the conditional, and so mistakenly ran on other
I/O errors.
This be seen running
qemu-system-x86_64 -monitor stdio
and entering 'info mtree', when running on a slow console
(eg a slow remote ssh session). The monitor would get into
an indefinite loop writing the same data until it managed
to send it all without getting EAGAIN.
Reported-by: Igor Mammedov <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
qemu-char.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 00caf65..ad11b75 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -896,13 +896,13 @@ static int io_channel_send_full(QIOChannel *ioc,
ioc, &iov, 1,
fds, nfds, NULL);
if (ret == QIO_CHANNEL_ERR_BLOCK) {
- errno = EAGAIN;
- return -1;
- } else if (ret < 0) {
if (offset) {
return offset;
}
+ errno = EAGAIN;
+ return -1;
+ } else if (ret < 0) {
errno = EINVAL;
return -1;
}
--
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, 2016/02/16
- [Qemu-devel] [PULL 04/28] char: fix handling of QIO_CHANNEL_ERR_BLOCK,
Paolo Bonzini <=
- [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
- [Qemu-devel] [PULL 16/28] nbd: convert qemu-nbd server to use I/O channels for connection setup, Paolo Bonzini, 2016/02/16