From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PULL 26/29] char: translate from QIOChannel error to errno
Date: Tue, 22 Mar 2016 15:17:06 +0100 [thread overview]
Message-ID: <1458656229-32043-27-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1458656229-32043-1-git-send-email-pbonzini@redhat.com>
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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 <marcandre.lureau@redhat.com>
Message-Id: <1457718924-19338-1-git-send-email-marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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
next prev parent reply other threads:[~2016-03-22 14:18 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 14:16 [Qemu-devel] [PULL 00/29] Miscellaneous changes for 2016-03-22 Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 01/29] include/qemu/osdep.h: Don't include qapi/error.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 02/29] Use scripts/clean-includes to drop redundant qemu/typedefs.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 03/29] Clean up includes some more Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 04/29] fw_cfg: Split fw_cfg_keys.h off fw_cfg.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 05/29] include/qemu/iov.h: Don't include qemu-common.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 06/29] include/hw/hw.h: " Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 07/29] hw/pci/pci.h: " Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 08/29] Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 09/29] Move QEMU_ALIGN_*() " Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 10/29] Move ParallelIOArg from qemu-common.h to sysemu/char.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 11/29] isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 12/29] include/crypto: Include qapi-types.h or qemu/bswap.h instead of qemu-common.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 13/29] hw: explicitly include qemu-common.h and cpu.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 14/29] Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 15/29] util: move declarations out of qemu-common.h Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 16/29] tcg: pass down TranslationBlock to tcg_code_gen Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 17/29] qemu-log: correct help text for -d cpu Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 18/29] qemu-log: Avoid function call for disabled qemu_log_mask logging Paolo Bonzini
2016-03-22 14:16 ` [Qemu-devel] [PULL 19/29] qemu-log: Improve the "exec" TB execution logging Paolo Bonzini
2016-03-22 14:17 ` [Qemu-devel] [PULL 20/29] qemu-log: new option -dfilter to limit output Paolo Bonzini
2016-03-22 14:17 ` [Qemu-devel] [PULL 21/29] qemu-log: dfilter-ise exec, out_asm, op and opt_op Paolo Bonzini
2016-03-22 14:17 ` [Qemu-devel] [PULL 22/29] target-arm: dfilter support for in_asm Paolo Bonzini
2016-03-22 14:17 ` [Qemu-devel] [PULL 23/29] qemu-log: support simple pid substitution for logs Paolo Bonzini
2016-03-22 14:17 ` [Qemu-devel] [PULL 24/29] cputlb: modernise the debug support Paolo Bonzini
2016-03-22 14:17 ` [Qemu-devel] [PULL 25/29] exec: fix error handling in file_ram_alloc Paolo Bonzini
2016-03-22 14:17 ` Paolo Bonzini [this message]
2016-03-22 14:17 ` [Qemu-devel] [PULL 27/29] char: ensure all clients are in non-blocking mode Paolo Bonzini
2016-03-22 14:17 ` [Qemu-devel] [PULL 28/29] config.status: Pass extra parameters Paolo Bonzini
2016-03-22 14:17 ` [Qemu-devel] [PULL 29/29] target-i386: implement PKE for TCG Paolo Bonzini
2016-03-22 20:27 ` [Qemu-devel] [PULL 00/29] Miscellaneous changes for 2016-03-22 Peter Maydell
2016-03-22 21:26 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1458656229-32043-27-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).