bdev: Use error_response() rather than bool_response(false) for JSON RPC
For JSON RPC, boolean response with false value may not be regarded as error. Previously many cases were replaced to use spdk_jsonrpc_send_error_response() explicitly. Replace one of the remaining cases in this patch. Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: I1b4ffe015c2b2e28d411faf7763c2baca81f66f5 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16623 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
0bac3197b8
commit
a6b0b5b072
@ -1084,7 +1084,11 @@ bdev_histogram_status_cb(void *cb_arg, int status)
|
||||
{
|
||||
struct spdk_jsonrpc_request *request = cb_arg;
|
||||
|
||||
spdk_jsonrpc_send_bool_response(request, status == 0);
|
||||
if (status == 0) {
|
||||
spdk_jsonrpc_send_bool_response(request, true);
|
||||
} else {
|
||||
spdk_jsonrpc_send_error_response(request, status, spdk_strerror(-status));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user