[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 26/29] char: translate from QIOChannel error to errno
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 26/29] char: translate from QIOChannel error to errno |
Date: |
Tue, 22 Mar 2016 15:17:06 +0100 |
From: Marc-André Lureau <address@hidden>
Caller of CharDriverState.chr* callback assume errno error conventions.
Translate QIOChannel error to errno (this fixes potential EAGAIN
regression, for ex if a vhost-user backend block, qemu_chr_fe_read_all()
could get error -2 and not wait)
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
qemu-char.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index 97aaaae..270819a 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2799,6 +2799,13 @@ static ssize_t tcp_chr_recv(CharDriverState *chr, char
*buf, size_t len)
NULL);
}
+ if (ret == QIO_CHANNEL_ERR_BLOCK) {
+ errno = EAGAIN;
+ ret = -1;
+ } else if (ret == -1) {
+ errno = EIO;
+ }
+
if (msgfds_num) {
/* close and clean read_msgfds */
for (i = 0; i < s->read_msgfds_num; i++) {
--
2.5.0
- [Qemu-devel] [PULL 01/29] include/qemu/osdep.h: Don't include qapi/error.h, (continued)
- [Qemu-devel] [PULL 01/29] include/qemu/osdep.h: Don't include qapi/error.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 14/29] Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 16/29] tcg: pass down TranslationBlock to tcg_code_gen, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 21/29] qemu-log: dfilter-ise exec, out_asm, op and opt_op, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 18/29] qemu-log: Avoid function call for disabled qemu_log_mask logging, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 20/29] qemu-log: new option -dfilter to limit output, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 19/29] qemu-log: Improve the "exec" TB execution logging, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 17/29] qemu-log: correct help text for -d cpu, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 23/29] qemu-log: support simple pid substitution for logs, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 22/29] target-arm: dfilter support for in_asm, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 26/29] char: translate from QIOChannel error to errno,
Paolo Bonzini <=
- [Qemu-devel] [PULL 15/29] util: move declarations out of qemu-common.h, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 25/29] exec: fix error handling in file_ram_alloc, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 24/29] cputlb: modernise the debug support, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 28/29] config.status: Pass extra parameters, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 29/29] target-i386: implement PKE for TCG, Paolo Bonzini, 2016/03/22
- [Qemu-devel] [PULL 27/29] char: ensure all clients are in non-blocking mode, Paolo Bonzini, 2016/03/22
- Re: [Qemu-devel] [PULL 00/29] Miscellaneous changes for 2016-03-22, Peter Maydell, 2016/03/22