RPC: rename rpc inflate_lvol_bdev to bdev_lvol_inflate
Change-Id: I56628060381218f25fb8bd5dfdf19fe7ca7e9da6 Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466698 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
975efa2aff
commit
7a294f4cf3
@ -304,7 +304,7 @@ Example response:
|
||||
"bdev_lvol_resize",
|
||||
"bdev_lvol_set_read_only",
|
||||
"bdev_lvol_decouple_parent",
|
||||
"inflate_lvol_bdev",
|
||||
"bdev_lvol_inflate",
|
||||
"bdev_lvol_rename",
|
||||
"bdev_lvol_clone",
|
||||
"snapshot_lvol_bdev",
|
||||
@ -5215,7 +5215,7 @@ Example response:
|
||||
}
|
||||
~~~
|
||||
|
||||
## inflate_lvol_bdev {#rpc_inflate_lvol_bdev}
|
||||
## bdev_lvol_inflate {#rpc_bdev_lvol_inflate}
|
||||
|
||||
Inflate a logical volume. All unallocated clusters are allocated and copied from the parent or zero filled if not allocated in the parent. Then all dependencies on the parent are removed.
|
||||
|
||||
@ -5232,7 +5232,7 @@ Example request:
|
||||
~~~
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "inflate_lvol_bdev",
|
||||
"method": "bdev_lvol_inflate",
|
||||
"id": 1,
|
||||
"params": {
|
||||
"name": "8d87fccc-c278-49f0-9d4c-6237951aca09"
|
||||
|
@ -149,7 +149,7 @@ bdev_lvol_set_read_only [-h] name
|
||||
Mark lvol bdev as read only
|
||||
optional arguments:
|
||||
-h, --help show help
|
||||
inflate_lvol_bdev [-h] name
|
||||
bdev_lvol_inflate [-h] name
|
||||
Inflate lvol bdev
|
||||
optional arguments:
|
||||
-h, --help show help
|
||||
|
@ -641,22 +641,22 @@ cleanup:
|
||||
SPDK_RPC_REGISTER("bdev_lvol_rename", spdk_rpc_bdev_lvol_rename, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_lvol_rename, rename_lvol_bdev)
|
||||
|
||||
struct rpc_inflate_lvol_bdev {
|
||||
struct rpc_bdev_lvol_inflate {
|
||||
char *name;
|
||||
};
|
||||
|
||||
static void
|
||||
free_rpc_inflate_lvol_bdev(struct rpc_inflate_lvol_bdev *req)
|
||||
free_rpc_bdev_lvol_inflate(struct rpc_bdev_lvol_inflate *req)
|
||||
{
|
||||
free(req->name);
|
||||
}
|
||||
|
||||
static const struct spdk_json_object_decoder rpc_inflate_lvol_bdev_decoders[] = {
|
||||
{"name", offsetof(struct rpc_inflate_lvol_bdev, name), spdk_json_decode_string},
|
||||
static const struct spdk_json_object_decoder rpc_bdev_lvol_inflate_decoders[] = {
|
||||
{"name", offsetof(struct rpc_bdev_lvol_inflate, name), spdk_json_decode_string},
|
||||
};
|
||||
|
||||
static void
|
||||
_spdk_rpc_inflate_lvol_bdev_cb(void *cb_arg, int lvolerrno)
|
||||
_spdk_rpc_bdev_lvol_inflate_cb(void *cb_arg, int lvolerrno)
|
||||
{
|
||||
struct spdk_json_write_ctx *w;
|
||||
struct spdk_jsonrpc_request *request = cb_arg;
|
||||
@ -676,17 +676,17 @@ invalid:
|
||||
}
|
||||
|
||||
static void
|
||||
spdk_rpc_inflate_lvol_bdev(struct spdk_jsonrpc_request *request,
|
||||
spdk_rpc_bdev_lvol_inflate(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_inflate_lvol_bdev req = {};
|
||||
struct rpc_bdev_lvol_inflate req = {};
|
||||
struct spdk_bdev *bdev;
|
||||
struct spdk_lvol *lvol;
|
||||
|
||||
SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "Inflating lvol\n");
|
||||
|
||||
if (spdk_json_decode_object(params, rpc_inflate_lvol_bdev_decoders,
|
||||
SPDK_COUNTOF(rpc_inflate_lvol_bdev_decoders),
|
||||
if (spdk_json_decode_object(params, rpc_bdev_lvol_inflate_decoders,
|
||||
SPDK_COUNTOF(rpc_bdev_lvol_inflate_decoders),
|
||||
&req)) {
|
||||
SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "spdk_json_decode_object failed\n");
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
|
||||
@ -708,26 +708,27 @@ spdk_rpc_inflate_lvol_bdev(struct spdk_jsonrpc_request *request,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
spdk_lvol_inflate(lvol, _spdk_rpc_inflate_lvol_bdev_cb, request);
|
||||
spdk_lvol_inflate(lvol, _spdk_rpc_bdev_lvol_inflate_cb, request);
|
||||
|
||||
cleanup:
|
||||
free_rpc_inflate_lvol_bdev(&req);
|
||||
free_rpc_bdev_lvol_inflate(&req);
|
||||
}
|
||||
|
||||
SPDK_RPC_REGISTER("inflate_lvol_bdev", spdk_rpc_inflate_lvol_bdev, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER("bdev_lvol_inflate", spdk_rpc_bdev_lvol_inflate, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_lvol_inflate, inflate_lvol_bdev)
|
||||
|
||||
static void
|
||||
spdk_rpc_bdev_lvol_decouple_parent(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_inflate_lvol_bdev req = {};
|
||||
struct rpc_bdev_lvol_inflate req = {};
|
||||
struct spdk_bdev *bdev;
|
||||
struct spdk_lvol *lvol;
|
||||
|
||||
SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "Decoupling parent of lvol\n");
|
||||
|
||||
if (spdk_json_decode_object(params, rpc_inflate_lvol_bdev_decoders,
|
||||
SPDK_COUNTOF(rpc_inflate_lvol_bdev_decoders),
|
||||
if (spdk_json_decode_object(params, rpc_bdev_lvol_inflate_decoders,
|
||||
SPDK_COUNTOF(rpc_bdev_lvol_inflate_decoders),
|
||||
&req)) {
|
||||
SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "spdk_json_decode_object failed\n");
|
||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
|
||||
@ -749,10 +750,10 @@ spdk_rpc_bdev_lvol_decouple_parent(struct spdk_jsonrpc_request *request,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
spdk_lvol_decouple_parent(lvol, _spdk_rpc_inflate_lvol_bdev_cb, request);
|
||||
spdk_lvol_decouple_parent(lvol, _spdk_rpc_bdev_lvol_inflate_cb, request);
|
||||
|
||||
cleanup:
|
||||
free_rpc_inflate_lvol_bdev(&req);
|
||||
free_rpc_bdev_lvol_inflate(&req);
|
||||
}
|
||||
|
||||
SPDK_RPC_REGISTER("bdev_lvol_decouple_parent", spdk_rpc_bdev_lvol_decouple_parent, SPDK_RPC_RUNTIME)
|
||||
|
@ -1228,13 +1228,14 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
p.add_argument('new_name', help='new lvol name')
|
||||
p.set_defaults(func=bdev_lvol_rename)
|
||||
|
||||
def inflate_lvol_bdev(args):
|
||||
rpc.lvol.inflate_lvol_bdev(args.client,
|
||||
def bdev_lvol_inflate(args):
|
||||
rpc.lvol.bdev_lvol_inflate(args.client,
|
||||
name=args.name)
|
||||
|
||||
p = subparsers.add_parser('inflate_lvol_bdev', help='Make thin provisioned lvol a thick provisioned lvol')
|
||||
p = subparsers.add_parser('bdev_lvol_inflate', aliases=['inflate_lvol_bdev'],
|
||||
help='Make thin provisioned lvol a thick provisioned lvol')
|
||||
p.add_argument('name', help='lvol bdev name')
|
||||
p.set_defaults(func=inflate_lvol_bdev)
|
||||
p.set_defaults(func=bdev_lvol_inflate)
|
||||
|
||||
def bdev_lvol_decouple_parent(args):
|
||||
rpc.lvol.bdev_lvol_decouple_parent(args.client,
|
||||
|
@ -155,7 +155,8 @@ def destroy_lvol_bdev(client, name):
|
||||
return client.call('destroy_lvol_bdev', params)
|
||||
|
||||
|
||||
def inflate_lvol_bdev(client, name):
|
||||
@deprecated_alias('inflate_lvol_bdev')
|
||||
def bdev_lvol_inflate(client, name):
|
||||
"""Inflate a logical volume.
|
||||
|
||||
Args:
|
||||
@ -164,7 +165,7 @@ def inflate_lvol_bdev(client, name):
|
||||
params = {
|
||||
'name': name,
|
||||
}
|
||||
return client.call('inflate_lvol_bdev', params)
|
||||
return client.call('bdev_lvol_inflate', params)
|
||||
|
||||
|
||||
@deprecated_alias('decouple_parent_lvol_bdev')
|
||||
|
@ -224,9 +224,9 @@ class Commands_Rpc(object):
|
||||
output, rc = self.rpc.bdev_lvol_clone(snapshot_name, clone_name)
|
||||
return rc
|
||||
|
||||
def inflate_lvol_bdev(self, clone_name):
|
||||
print("INFO: RPC COMMAND inflate_lvol_bdev")
|
||||
output, rc = self.rpc.inflate_lvol_bdev(clone_name)
|
||||
def bdev_lvol_inflate(self, clone_name):
|
||||
print("INFO: RPC COMMAND bdev_lvol_inflate")
|
||||
output, rc = self.rpc.bdev_lvol_inflate(clone_name)
|
||||
return rc
|
||||
|
||||
def bdev_lvol_decouple_parent(self, clone_name):
|
||||
|
@ -2629,7 +2629,7 @@ class TestCases(object):
|
||||
self.c.stop_nbd_disk(nbd_name)
|
||||
|
||||
# Do inflate
|
||||
fail_count += self.c.inflate_lvol_bdev(lvol_clone['name'])
|
||||
fail_count += self.c.bdev_lvol_inflate(lvol_clone['name'])
|
||||
lvol_clone = self.c.get_lvol_bdev_with_name(self.lvs_name + "/" + self.lbd_name)
|
||||
if lvol_clone['driver_specific']['lvol']['thin_provision'] is not False:
|
||||
fail_count += 1
|
||||
|
@ -52,7 +52,7 @@ sleep 1
|
||||
snapshot=$($rpc_py snapshot_lvol_bdev $lvol "MY_SNAPSHOT")
|
||||
$rpc_py bdev_lvol_resize $lvol $LVOL_BDEV_FINAL_SIZE
|
||||
clone=$($rpc_py bdev_lvol_clone $snapshot "MY_CLONE")
|
||||
$rpc_py inflate_lvol_bdev $clone
|
||||
$rpc_py bdev_lvol_inflate $clone
|
||||
|
||||
# Wait for I/O to complete
|
||||
wait $perf_pid
|
||||
|
Loading…
x
Reference in New Issue
Block a user