bdev/rpc: make get_bdevs_iostat name param optional
Similar to commit 75896c2510ee ("bdev/rpc: make get_bdevs/config "name" params optional"), make "name" fully optional so that specifying an empty params object works. Change-Id: Id4703544a32cd3e383a86debf50df1015b58e457 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/412295 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
bcff4c89b8
commit
7f51e8e5e2
@ -117,22 +117,19 @@ spdk_rpc_get_bdevs_iostat(struct spdk_jsonrpc_request *request,
|
||||
&req)) {
|
||||
SPDK_ERRLOG("spdk_json_decode_object failed\n");
|
||||
goto invalid;
|
||||
} else {
|
||||
if (req.name == NULL) {
|
||||
SPDK_ERRLOG("missing name param\n");
|
||||
goto invalid;
|
||||
}
|
||||
}
|
||||
|
||||
if (req.name) {
|
||||
bdev = spdk_bdev_get_by_name(req.name);
|
||||
if (bdev == NULL) {
|
||||
SPDK_ERRLOG("bdev '%s' does not exist\n", req.name);
|
||||
goto invalid;
|
||||
}
|
||||
|
||||
free_rpc_get_bdevs_iostat(&req);
|
||||
}
|
||||
}
|
||||
|
||||
free_rpc_get_bdevs_iostat(&req);
|
||||
|
||||
ctx = calloc(1, sizeof(struct rpc_get_bdevs_iostat_ctx));
|
||||
if (ctx == NULL) {
|
||||
SPDK_ERRLOG("Failed to allocate rpc_get_bdevs_iostat_ctx struct\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user