From: Greg Edwards <gedwards@ddn.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Greg Edwards" <gedwards@ddn.com>
Subject: [Qemu-devel] [PATCH] char: report errors from qio_channel_{read, write}v_full
Date: Thu, 28 Sep 2017 14:52:11 -0600 [thread overview]
Message-ID: <20170928205211.15641-1-gedwards@ddn.com> (raw)
Two callers of qio_channel_{read,write}v_full were not passing in an
Error pointer, missing any error messages from the channel class
io_{read,write}v methods.
Signed-off-by: Greg Edwards <gedwards@ddn.com>
---
chardev/char-io.c | 7 ++++++-
chardev/char-socket.c | 8 ++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/chardev/char-io.c b/chardev/char-io.c
index f81052481a55..7d8287cbfe31 100644
--- a/chardev/char-io.c
+++ b/chardev/char-io.c
@@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "chardev/char-io.h"
typedef struct IOWatchPoll {
@@ -152,6 +153,7 @@ int io_channel_send_full(QIOChannel *ioc,
int *fds, size_t nfds)
{
size_t offset = 0;
+ Error *local_err = NULL;
while (offset < len) {
ssize_t ret = 0;
@@ -160,7 +162,10 @@ int io_channel_send_full(QIOChannel *ioc,
ret = qio_channel_writev_full(
ioc, &iov, 1,
- fds, nfds, NULL);
+ fds, nfds, &local_err);
+ if (local_err) {
+ error_report_err(local_err);
+ }
if (ret == QIO_CHANNEL_ERR_BLOCK) {
if (offset) {
return offset;
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index e65148fe973c..4e27370440ff 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -272,15 +272,19 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)
size_t i;
int *msgfds = NULL;
size_t msgfds_num = 0;
+ Error *local_err = NULL;
if (qio_channel_has_feature(s->ioc, QIO_CHANNEL_FEATURE_FD_PASS)) {
ret = qio_channel_readv_full(s->ioc, &iov, 1,
&msgfds, &msgfds_num,
- NULL);
+ &local_err);
} else {
ret = qio_channel_readv_full(s->ioc, &iov, 1,
NULL, NULL,
- NULL);
+ &local_err);
+ }
+ if (local_err) {
+ error_report_err(local_err);
}
if (ret == QIO_CHANNEL_ERR_BLOCK) {
--
2.13.5
next reply other threads:[~2017-09-28 21:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 20:52 Greg Edwards [this message]
2017-09-29 9:12 ` [Qemu-devel] [PATCH] char: report errors from qio_channel_{read, write}v_full Paolo Bonzini
2017-09-29 21:59 ` Greg Edwards
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=20170928205211.15641-1-gedwards@ddn.com \
--to=gedwards@ddn.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.