RPC: rename rpc get_lvol_stores to bdev_lvol_get_lvstores
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com> Change-Id: I419488ba971d523fd5285a51d467fbac9dd218a2 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466282 Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
9f5cbf4c7f
commit
0b3f378f7a
@ -433,7 +433,7 @@ This will create lvol store named `lvs` with cluster size 4096, build on top of
|
||||
`Malloc2` bdev. In response user will be provided with uuid which is unique lvol store
|
||||
identifier.
|
||||
|
||||
User can get list of available lvol stores using `get_lvol_stores` RPC command (no
|
||||
User can get list of available lvol stores using `bdev_lvol_get_lvstores` RPC command (no
|
||||
parameters available).
|
||||
|
||||
Example response
|
||||
|
@ -299,7 +299,7 @@ Example response:
|
||||
"bdev_malloc_create",
|
||||
"delete_ftl_bdev",
|
||||
"construct_ftl_bdev",
|
||||
"get_lvol_stores",
|
||||
"bdev_lvol_get_lvstores",
|
||||
"destroy_lvol_bdev",
|
||||
"resize_lvol_bdev",
|
||||
"set_read_only_lvol_bdev",
|
||||
@ -4852,7 +4852,7 @@ Example response:
|
||||
}
|
||||
~~~
|
||||
|
||||
## get_lvol_stores {#rpc_get_lvol_stores}
|
||||
## bdev_lvol_get_lvstores {#rpc_bdev_lvol_get_lvstores}
|
||||
|
||||
Get a list of logical volume stores.
|
||||
|
||||
@ -4873,7 +4873,7 @@ Example request:
|
||||
~~~
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "get_lvol_stores",
|
||||
"method": "bdev_lvol_get_lvstores",
|
||||
"id": 1,
|
||||
"params": {
|
||||
"lvs_name": "LVS0"
|
||||
|
@ -97,7 +97,7 @@ destroy_lvol_store [-h] [-u UUID] [-l LVS_NAME]
|
||||
using destroy_lvol_bdev rpc call.
|
||||
optional arguments:
|
||||
-h, --help show help
|
||||
get_lvol_stores [-h] [-u UUID] [-l LVS_NAME]
|
||||
bdev_lvol_get_lvstores [-h] [-u UUID] [-l LVS_NAME]
|
||||
Display current logical volume store list
|
||||
optional arguments:
|
||||
-h, --help show help
|
||||
|
@ -985,21 +985,21 @@ cleanup:
|
||||
|
||||
SPDK_RPC_REGISTER("destroy_lvol_bdev", spdk_rpc_destroy_lvol_bdev, SPDK_RPC_RUNTIME)
|
||||
|
||||
struct rpc_get_lvol_stores {
|
||||
struct rpc_bdev_lvol_get_lvstores {
|
||||
char *uuid;
|
||||
char *lvs_name;
|
||||
};
|
||||
|
||||
static void
|
||||
free_rpc_get_lvol_stores(struct rpc_get_lvol_stores *req)
|
||||
free_rpc_bdev_lvol_get_lvstores(struct rpc_bdev_lvol_get_lvstores *req)
|
||||
{
|
||||
free(req->uuid);
|
||||
free(req->lvs_name);
|
||||
}
|
||||
|
||||
static const struct spdk_json_object_decoder rpc_get_lvol_stores_decoders[] = {
|
||||
{"uuid", offsetof(struct rpc_get_lvol_stores, uuid), spdk_json_decode_string, true},
|
||||
{"lvs_name", offsetof(struct rpc_get_lvol_stores, lvs_name), spdk_json_decode_string, true},
|
||||
static const struct spdk_json_object_decoder rpc_bdev_lvol_get_lvstores_decoders[] = {
|
||||
{"uuid", offsetof(struct rpc_bdev_lvol_get_lvstores, uuid), spdk_json_decode_string, true},
|
||||
{"lvs_name", offsetof(struct rpc_bdev_lvol_get_lvstores, lvs_name), spdk_json_decode_string, true},
|
||||
};
|
||||
|
||||
static void
|
||||
@ -1035,18 +1035,18 @@ spdk_rpc_dump_lvol_store_info(struct spdk_json_write_ctx *w, struct lvol_store_b
|
||||
}
|
||||
|
||||
static void
|
||||
spdk_rpc_get_lvol_stores(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
spdk_rpc_bdev_lvol_get_lvstores(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_get_lvol_stores req = {};
|
||||
struct rpc_bdev_lvol_get_lvstores req = {};
|
||||
struct spdk_json_write_ctx *w;
|
||||
struct lvol_store_bdev *lvs_bdev = NULL;
|
||||
struct spdk_lvol_store *lvs = NULL;
|
||||
int rc;
|
||||
|
||||
if (params != NULL) {
|
||||
if (spdk_json_decode_object(params, rpc_get_lvol_stores_decoders,
|
||||
SPDK_COUNTOF(rpc_get_lvol_stores_decoders),
|
||||
if (spdk_json_decode_object(params, rpc_bdev_lvol_get_lvstores_decoders,
|
||||
SPDK_COUNTOF(rpc_bdev_lvol_get_lvstores_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,
|
||||
@ -1083,7 +1083,8 @@ spdk_rpc_get_lvol_stores(struct spdk_jsonrpc_request *request,
|
||||
spdk_jsonrpc_end_result(request, w);
|
||||
|
||||
cleanup:
|
||||
free_rpc_get_lvol_stores(&req);
|
||||
free_rpc_bdev_lvol_get_lvstores(&req);
|
||||
}
|
||||
|
||||
SPDK_RPC_REGISTER("get_lvol_stores", spdk_rpc_get_lvol_stores, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER("bdev_lvol_get_lvstores", spdk_rpc_bdev_lvol_get_lvstores, SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(bdev_lvol_get_lvstores, get_lvol_stores)
|
||||
|
@ -1267,15 +1267,16 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
||||
p.add_argument('-l', '--lvs-name', help='lvol store name', required=False)
|
||||
p.set_defaults(func=destroy_lvol_store)
|
||||
|
||||
def get_lvol_stores(args):
|
||||
print_dict(rpc.lvol.get_lvol_stores(args.client,
|
||||
uuid=args.uuid,
|
||||
lvs_name=args.lvs_name))
|
||||
def bdev_lvol_get_lvstores(args):
|
||||
print_dict(rpc.lvol.bdev_lvol_get_lvstores(args.client,
|
||||
uuid=args.uuid,
|
||||
lvs_name=args.lvs_name))
|
||||
|
||||
p = subparsers.add_parser('get_lvol_stores', help='Display current logical volume store list')
|
||||
p = subparsers.add_parser('bdev_lvol_get_lvstores', aliases=['get_lvol_stores'],
|
||||
help='Display current logical volume store list')
|
||||
p.add_argument('-u', '--uuid', help='lvol store UUID', required=False)
|
||||
p.add_argument('-l', '--lvs-name', help='lvol store name', required=False)
|
||||
p.set_defaults(func=get_lvol_stores)
|
||||
p.set_defaults(func=bdev_lvol_get_lvstores)
|
||||
|
||||
def get_raid_bdevs(args):
|
||||
print_array(rpc.bdev.get_raid_bdevs(args.client,
|
||||
|
@ -197,7 +197,8 @@ def destroy_lvol_store(client, uuid=None, lvs_name=None):
|
||||
return client.call('destroy_lvol_store', params)
|
||||
|
||||
|
||||
def get_lvol_stores(client, uuid=None, lvs_name=None):
|
||||
@deprecated_alias('get_lvol_stores')
|
||||
def bdev_lvol_get_lvstores(client, uuid=None, lvs_name=None):
|
||||
"""List logical volume stores.
|
||||
|
||||
Args:
|
||||
@ -214,4 +215,4 @@ def get_lvol_stores(client, uuid=None, lvs_name=None):
|
||||
params['uuid'] = uuid
|
||||
if lvs_name:
|
||||
params['lvs_name'] = lvs_name
|
||||
return client.call('get_lvol_stores', params)
|
||||
return client.call('bdev_lvol_get_lvstores', params)
|
||||
|
@ -85,7 +85,7 @@ class UILvolStores(UINode):
|
||||
|
||||
def refresh(self):
|
||||
self._children = set([])
|
||||
for lvs in self.get_root().get_lvol_stores():
|
||||
for lvs in self.get_root().bdev_lvol_get_lvstores():
|
||||
UILvsObj(lvs, self)
|
||||
|
||||
def delete(self, name, uuid):
|
||||
|
@ -190,9 +190,9 @@ class UIRoot(UINode):
|
||||
|
||||
@verbose
|
||||
@is_method_available
|
||||
def get_lvol_stores(self):
|
||||
def bdev_lvol_get_lvstores(self):
|
||||
if self.is_init:
|
||||
self.current_lvol_stores = rpc.lvol.get_lvol_stores(self.client)
|
||||
self.current_lvol_stores = rpc.lvol.bdev_lvol_get_lvstores(self.client)
|
||||
for lvs in self.current_lvol_stores:
|
||||
yield LvolStore(lvs)
|
||||
|
||||
|
@ -778,7 +778,7 @@ function fio_nvme()
|
||||
function get_lvs_free_mb()
|
||||
{
|
||||
local lvs_uuid=$1
|
||||
local lvs_info=$($rpc_py get_lvol_stores)
|
||||
local lvs_info=$($rpc_py bdev_lvol_get_lvstores)
|
||||
local fc=$(jq ".[] | select(.uuid==\"$lvs_uuid\") .free_clusters" <<< "$lvs_info")
|
||||
local cs=$(jq ".[] | select(.uuid==\"$lvs_uuid\") .cluster_size" <<< "$lvs_info")
|
||||
|
||||
|
@ -62,9 +62,9 @@ class Commands_Rpc(object):
|
||||
json_value=json_value))
|
||||
return 1
|
||||
|
||||
def check_get_lvol_stores(self, base_name, uuid, cluster_size=None, lvs_name=""):
|
||||
print("INFO: RPC COMMAND get_lvol_stores")
|
||||
json_value = self.get_lvol_stores()
|
||||
def check_bdev_lvol_get_lvstores(self, base_name, uuid, cluster_size=None, lvs_name=""):
|
||||
print("INFO: RPC COMMAND bdev_lvol_get_lvstores")
|
||||
json_value = self.bdev_lvol_get_lvstores()
|
||||
if json_value:
|
||||
for i in range(len(json_value)):
|
||||
json_uuid = json_value[i]['uuid']
|
||||
@ -75,14 +75,14 @@ class Commands_Rpc(object):
|
||||
if base_name in json_base_name \
|
||||
and uuid in json_uuid:
|
||||
print("INFO: base_name:{base_name} is found in RPC "
|
||||
"Command: get_lvol_stores "
|
||||
"Command: bdev_lvol_get_lvstores "
|
||||
"response".format(base_name=base_name))
|
||||
print("INFO: UUID:{uuid} is found in RPC Command: "
|
||||
"get_lvol_stores response".format(uuid=uuid))
|
||||
"bdev_lvol_get_lvstores response".format(uuid=uuid))
|
||||
if cluster_size:
|
||||
if str(cluster_size) in str(json_cluster):
|
||||
print("Info: Cluster size :{cluster_size} is found in RPC "
|
||||
"Command: get_lvol_stores "
|
||||
"Command: bdev_lvol_get_lvstores "
|
||||
"response".format(cluster_size=cluster_size))
|
||||
else:
|
||||
print("ERROR: Wrong cluster size in lvol store")
|
||||
@ -99,8 +99,8 @@ class Commands_Rpc(object):
|
||||
return 1
|
||||
return 0
|
||||
print("FAILED: UUID: lvol store {uuid} on base_bdev: "
|
||||
"{base_name} not found in get_lvol_stores()".format(uuid=uuid,
|
||||
base_name=base_name))
|
||||
"{base_name} not found in bdev_lvol_get_lvstores()".format(uuid=uuid,
|
||||
base_name=base_name))
|
||||
return 1
|
||||
else:
|
||||
print("INFO: Lvol store not exist")
|
||||
@ -179,12 +179,12 @@ class Commands_Rpc(object):
|
||||
output, rc = self.rpc.stop_nbd_disk(nbd_name)
|
||||
return rc
|
||||
|
||||
def get_lvol_stores(self, name=None):
|
||||
print("INFO: RPC COMMAND get_lvol_stores")
|
||||
def bdev_lvol_get_lvstores(self, name=None):
|
||||
print("INFO: RPC COMMAND bdev_lvol_get_lvstores")
|
||||
if name:
|
||||
output = json.loads(self.rpc.get_lvol_stores("-l", name)[0])
|
||||
output = json.loads(self.rpc.bdev_lvol_get_lvstores("-l", name)[0])
|
||||
else:
|
||||
output = json.loads(self.rpc.get_lvol_stores()[0])
|
||||
output = json.loads(self.rpc.bdev_lvol_get_lvstores()[0])
|
||||
return output
|
||||
|
||||
def get_lvol_bdevs(self):
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -171,7 +171,7 @@ done
|
||||
|
||||
bdev_info=$($rpc_py get_bdevs)
|
||||
notice "Configuration after initial set-up:"
|
||||
$rpc_py get_lvol_stores
|
||||
$rpc_py bdev_lvol_get_lvstores
|
||||
echo "$bdev_info"
|
||||
|
||||
# Set up VMs
|
||||
@ -277,7 +277,7 @@ fi
|
||||
|
||||
clean_lvol_cfg
|
||||
|
||||
$rpc_py get_lvol_stores
|
||||
$rpc_py bdev_lvol_get_lvstores
|
||||
$rpc_py get_bdevs
|
||||
$rpc_py get_vhost_controllers
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user