bdev/rbd: use consistent block_size name in RPC

Rename the construct_rbd_bdev "size" parameter to block_size so that it
is consistent with other bdev construct RPCs.

Change-Id: I88f8ed35444495ffce9550dc224fbcbd58231787
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-10-27 11:16:52 -07:00
parent 075ba523bd
commit 7d30f5aa1e
2 changed files with 5 additions and 5 deletions

View File

@ -38,7 +38,7 @@
struct rpc_construct_rbd {
char *pool_name;
char *rbd_name;
int32_t size;
uint32_t block_size;
};
static void
@ -51,7 +51,7 @@ free_rpc_construct_rbd(struct rpc_construct_rbd *req)
static const struct spdk_json_object_decoder rpc_construct_rbd_decoders[] = {
{"pool_name", offsetof(struct rpc_construct_rbd, pool_name), spdk_json_decode_string},
{"rbd_name", offsetof(struct rpc_construct_rbd, rbd_name), spdk_json_decode_string},
{"size", offsetof(struct rpc_construct_rbd, size), spdk_json_decode_int32},
{"block_size", offsetof(struct rpc_construct_rbd, block_size), spdk_json_decode_uint32},
};
static void
@ -70,7 +70,7 @@ spdk_rpc_construct_rbd_bdev(struct spdk_jsonrpc_server_conn *conn,
goto invalid;
}
bdev = spdk_bdev_rbd_create(req.pool_name, req.rbd_name, req.size);
bdev = spdk_bdev_rbd_create(req.pool_name, req.rbd_name, req.block_size);
if (bdev == NULL) {
goto invalid;
}

View File

@ -181,14 +181,14 @@ def construct_rbd_bdev(args):
params = {
'pool_name': args.pool_name,
'rbd_name': args.rbd_name,
'size': args.size,
'block_size': args.block_size,
}
print_array(jsonrpc_call('construct_rbd_bdev', params))
p = subparsers.add_parser('construct_rbd_bdev', help='Add a bdev with ceph rbd backend')
p.add_argument('pool_name', help='rbd pool name')
p.add_argument('rbd_name', help='rbd image name')
p.add_argument('size', help='rbd block size', type=int)
p.add_argument('block_size', help='rbd block size', type=int)
p.set_defaults(func=construct_rbd_bdev)
def set_trace_flag(args):