From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
"open list:Network Block Dev..." <qemu-block@nongnu.org>
Subject: [Qemu-devel] [PULL 2/8] nbd/client: Trace all server option error messages
Date: Sat, 5 Jan 2019 08:00:54 -0600 [thread overview]
Message-ID: <20190105140100.26913-3-eblake@redhat.com> (raw)
In-Reply-To: <20190105140100.26913-1-eblake@redhat.com>
Not all servers send free-form text alongside option error replies, but
for servers that do (such as qemu), we pass the server's message as a
hint alongside our own error reporting. However, it would also be
useful to trace such server messages, since we can't guarantee how the
hint may be consumed.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20181218225714.284495-3-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
nbd/client.c | 2 ++
nbd/trace-events | 1 +
2 files changed, 3 insertions(+)
diff --git a/nbd/client.c b/nbd/client.c
index b4d457a19ad..0ad7147ed95 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -171,6 +171,8 @@ static int nbd_handle_reply_err(QIOChannel *ioc, NBDOptionReply *reply,
goto cleanup;
}
msg[reply->length] = '\0';
+ trace_nbd_server_error_msg(reply->type,
+ nbd_reply_type_lookup(reply->type), msg);
}
switch (reply->type) {
diff --git a/nbd/trace-events b/nbd/trace-events
index 5e1d4afe8e6..5492042acbf 100644
--- a/nbd/trace-events
+++ b/nbd/trace-events
@@ -1,6 +1,7 @@
# nbd/client.c
nbd_send_option_request(uint32_t opt, const char *name, uint32_t len) "Sending option request %" PRIu32" (%s), len %" PRIu32
nbd_receive_option_reply(uint32_t option, const char *optname, uint32_t type, const char *typename, uint32_t length) "Received option reply %" PRIu32" (%s), type %" PRIu32" (%s), len %" PRIu32
+nbd_server_error_msg(uint32_t err, const char *type, const char *msg) "server reported error 0x%" PRIx32 " (%s) with additional message: %s"
nbd_reply_err_unsup(uint32_t option, const char *name) "server doesn't understand request %" PRIu32 " (%s), attempting fallback"
nbd_opt_go_start(const char *name) "Attempting NBD_OPT_GO for export '%s'"
nbd_opt_go_success(void) "Export is good to go"
--
2.20.1
next prev parent reply other threads:[~2019-01-05 14:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-05 14:00 [Qemu-devel] [PULL 0/8] NBD patches through 2019-01-05 Eric Blake
2019-01-05 14:00 ` [Qemu-devel] [PULL 1/8] nbd: publish _lookup functions Eric Blake
2019-01-05 14:00 ` Eric Blake [this message]
2019-01-05 14:00 ` [Qemu-devel] [PULL 3/8] block/nbd-client: use traces instead of noisy error_report_err Eric Blake
2019-01-05 14:00 ` [Qemu-devel] [PULL 4/8] qemu-nbd: Use program name in error messages Eric Blake
2019-01-05 14:00 ` [Qemu-devel] [PULL 5/8] nbd: Document timeline of various features Eric Blake
2019-01-05 14:00 ` [Qemu-devel] [PULL 6/8] nbd/client: More consistent error messages Eric Blake
2019-01-05 14:00 ` [Qemu-devel] [PULL 7/8] qemu-nbd: Fail earlier for -c/-d on non-linux Eric Blake
2019-01-05 14:01 ` [Qemu-devel] [PULL 8/8] nbd/client: Drop pointless buf variable Eric Blake
2019-01-07 14:11 ` [Qemu-devel] [PULL 0/8] NBD patches through 2019-01-05 Peter Maydell
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=20190105140100.26913-3-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/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).