[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 5/9] nbd/client: fix error messages in nbd_handle_re
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[Qemu-block] [PATCH 5/9] nbd/client: fix error messages in nbd_handle_reply_err |
Date: |
Thu, 15 Feb 2018 16:51:43 +0300 |
1. NBD_REP_ERR_INVALID is not only about length, so, make message more
general
2. hex format is not very good: it's hard to read something like
"option a (set meta context)", so switch to dec.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
nbd/client.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/nbd/client.c b/nbd/client.c
index 89f80f9590..1f730341c0 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -180,22 +180,22 @@ static int nbd_handle_reply_err(QIOChannel *ioc,
NBDOptionReply *reply,
goto cleanup;
case NBD_REP_ERR_POLICY:
- error_setg(errp, "Denied by server for option %" PRIx32 " (%s)",
+ error_setg(errp, "Denied by server for option %" PRIu32 " (%s)",
reply->option, nbd_opt_lookup(reply->option));
break;
case NBD_REP_ERR_INVALID:
- error_setg(errp, "Invalid data length for option %" PRIx32 " (%s)",
+ error_setg(errp, "Invalid parameters for option %" PRIu32 " (%s)",
reply->option, nbd_opt_lookup(reply->option));
break;
case NBD_REP_ERR_PLATFORM:
- error_setg(errp, "Server lacks support for option %" PRIx32 " (%s)",
+ error_setg(errp, "Server lacks support for option %" PRIu32 " (%s)",
reply->option, nbd_opt_lookup(reply->option));
break;
case NBD_REP_ERR_TLS_REQD:
- error_setg(errp, "TLS negotiation required before option %" PRIx32
+ error_setg(errp, "TLS negotiation required before option %" PRIu32
" (%s)", reply->option, nbd_opt_lookup(reply->option));
break;
@@ -204,17 +204,17 @@ static int nbd_handle_reply_err(QIOChannel *ioc,
NBDOptionReply *reply,
break;
case NBD_REP_ERR_SHUTDOWN:
- error_setg(errp, "Server shutting down before option %" PRIx32 " (%s)",
+ error_setg(errp, "Server shutting down before option %" PRIu32 " (%s)",
reply->option, nbd_opt_lookup(reply->option));
break;
case NBD_REP_ERR_BLOCK_SIZE_REQD:
- error_setg(errp, "Server requires INFO_BLOCK_SIZE for option %" PRIx32
+ error_setg(errp, "Server requires INFO_BLOCK_SIZE for option %" PRIu32
" (%s)", reply->option, nbd_opt_lookup(reply->option));
break;
default:
- error_setg(errp, "Unknown error code when asking for option %" PRIx32
+ error_setg(errp, "Unknown error code when asking for option %" PRIu32
" (%s)", reply->option, nbd_opt_lookup(reply->option));
break;
}
--
2.11.1
- Re: [Qemu-block] [PATCH 2/9] nbd: change indenting in nbd.h, (continued)
[Qemu-block] [PATCH 5/9] nbd/client: fix error messages in nbd_handle_reply_err,
Vladimir Sementsov-Ogievskiy <=
[Qemu-block] [PATCH 7/9] iotests.py: tiny refactor: move system imports up, Vladimir Sementsov-Ogievskiy, 2018/02/15
[Qemu-block] [PATCH 9/9] iotests: new test 206 for NBD BLOCK_STATUS, Vladimir Sementsov-Ogievskiy, 2018/02/15
[Qemu-block] [PATCH 8/9] iotests: add file_path helper, Vladimir Sementsov-Ogievskiy, 2018/02/15
[Qemu-block] [PATCH 6/9] nbd: BLOCK_STATUS for standard get_block_status function: client part, Vladimir Sementsov-Ogievskiy, 2018/02/15