From ee3ec3f7c205818af33a7ebf675a4df56811cebf Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Thu, 7 Jul 2022 13:07:10 +0200 Subject: [PATCH] vhost/rpc: return errno from virtio_blk_create_transport This will allow the code calling this RPC to interpret the error and check whether the transport already exists (-EEXIST) or some other error occurred. Signed-off-by: Konrad Sztyber Change-Id: I8c4af84763ddba908c59ff881b09834a439186a8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13577 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu Reviewed-by: Dong Yi --- lib/vhost/vhost_rpc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/vhost/vhost_rpc.c b/lib/vhost/vhost_rpc.c index 03d5fde98..e7b7719b9 100644 --- a/lib/vhost/vhost_rpc.c +++ b/lib/vhost/vhost_rpc.c @@ -513,8 +513,7 @@ rpc_virtio_blk_create_transport(struct spdk_jsonrpc_request *request, invalid: free_rpc_virtio_blk_create_transport(&req); - spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, - spdk_strerror(-rc)); + spdk_jsonrpc_send_error_response(request, rc, spdk_strerror(-rc)); } SPDK_RPC_REGISTER("virtio_blk_create_transport", rpc_virtio_blk_create_transport, SPDK_RPC_RUNTIME)