iscsi: 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: Ibfcb8c53662238b7ba8f08ecd1678953af8dc202 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16622 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
841cd8b939
commit
0bac3197b8
@ -587,7 +587,11 @@ rpc_iscsi_delete_target_node_done(void *cb_arg, int rc)
|
||||
struct rpc_iscsi_delete_target_node_ctx *ctx = cb_arg;
|
||||
|
||||
free_rpc_iscsi_delete_target_node(&ctx->req);
|
||||
spdk_jsonrpc_send_bool_response(ctx->request, rc == 0);
|
||||
if (rc == 0) {
|
||||
spdk_jsonrpc_send_bool_response(ctx->request, true);
|
||||
} else {
|
||||
spdk_jsonrpc_send_error_response(ctx->request, rc, spdk_strerror(-rc));
|
||||
}
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user