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
|
`Malloc2` bdev. In response user will be provided with uuid which is unique lvol store
|
||||||
identifier.
|
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).
|
parameters available).
|
||||||
|
|
||||||
Example response
|
Example response
|
||||||
|
@ -299,7 +299,7 @@ Example response:
|
|||||||
"bdev_malloc_create",
|
"bdev_malloc_create",
|
||||||
"delete_ftl_bdev",
|
"delete_ftl_bdev",
|
||||||
"construct_ftl_bdev",
|
"construct_ftl_bdev",
|
||||||
"get_lvol_stores",
|
"bdev_lvol_get_lvstores",
|
||||||
"destroy_lvol_bdev",
|
"destroy_lvol_bdev",
|
||||||
"resize_lvol_bdev",
|
"resize_lvol_bdev",
|
||||||
"set_read_only_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.
|
Get a list of logical volume stores.
|
||||||
|
|
||||||
@ -4873,7 +4873,7 @@ Example request:
|
|||||||
~~~
|
~~~
|
||||||
{
|
{
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"method": "get_lvol_stores",
|
"method": "bdev_lvol_get_lvstores",
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"params": {
|
"params": {
|
||||||
"lvs_name": "LVS0"
|
"lvs_name": "LVS0"
|
||||||
|
@ -97,7 +97,7 @@ destroy_lvol_store [-h] [-u UUID] [-l LVS_NAME]
|
|||||||
using destroy_lvol_bdev rpc call.
|
using destroy_lvol_bdev rpc call.
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show help
|
-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
|
Display current logical volume store list
|
||||||
optional arguments:
|
optional arguments:
|
||||||
-h, --help show help
|
-h, --help show help
|
||||||
|
@ -985,21 +985,21 @@ cleanup:
|
|||||||
|
|
||||||
SPDK_RPC_REGISTER("destroy_lvol_bdev", spdk_rpc_destroy_lvol_bdev, SPDK_RPC_RUNTIME)
|
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 *uuid;
|
||||||
char *lvs_name;
|
char *lvs_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
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->uuid);
|
||||||
free(req->lvs_name);
|
free(req->lvs_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct spdk_json_object_decoder rpc_get_lvol_stores_decoders[] = {
|
static const struct spdk_json_object_decoder rpc_bdev_lvol_get_lvstores_decoders[] = {
|
||||||
{"uuid", offsetof(struct rpc_get_lvol_stores, uuid), spdk_json_decode_string, true},
|
{"uuid", offsetof(struct rpc_bdev_lvol_get_lvstores, uuid), spdk_json_decode_string, true},
|
||||||
{"lvs_name", offsetof(struct rpc_get_lvol_stores, lvs_name), spdk_json_decode_string, true},
|
{"lvs_name", offsetof(struct rpc_bdev_lvol_get_lvstores, lvs_name), spdk_json_decode_string, true},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1035,18 +1035,18 @@ spdk_rpc_dump_lvol_store_info(struct spdk_json_write_ctx *w, struct lvol_store_b
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_rpc_get_lvol_stores(struct spdk_jsonrpc_request *request,
|
spdk_rpc_bdev_lvol_get_lvstores(struct spdk_jsonrpc_request *request,
|
||||||
const struct spdk_json_val *params)
|
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 spdk_json_write_ctx *w;
|
||||||
struct lvol_store_bdev *lvs_bdev = NULL;
|
struct lvol_store_bdev *lvs_bdev = NULL;
|
||||||
struct spdk_lvol_store *lvs = NULL;
|
struct spdk_lvol_store *lvs = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (params != NULL) {
|
if (params != NULL) {
|
||||||
if (spdk_json_decode_object(params, rpc_get_lvol_stores_decoders,
|
if (spdk_json_decode_object(params, rpc_bdev_lvol_get_lvstores_decoders,
|
||||||
SPDK_COUNTOF(rpc_get_lvol_stores_decoders),
|
SPDK_COUNTOF(rpc_bdev_lvol_get_lvstores_decoders),
|
||||||
&req)) {
|
&req)) {
|
||||||
SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "spdk_json_decode_object failed\n");
|
SPDK_INFOLOG(SPDK_LOG_LVOL_RPC, "spdk_json_decode_object failed\n");
|
||||||
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR,
|
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);
|
spdk_jsonrpc_end_result(request, w);
|
||||||
|
|
||||||
cleanup:
|
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.add_argument('-l', '--lvs-name', help='lvol store name', required=False)
|
||||||
p.set_defaults(func=destroy_lvol_store)
|
p.set_defaults(func=destroy_lvol_store)
|
||||||
|
|
||||||
def get_lvol_stores(args):
|
def bdev_lvol_get_lvstores(args):
|
||||||
print_dict(rpc.lvol.get_lvol_stores(args.client,
|
print_dict(rpc.lvol.bdev_lvol_get_lvstores(args.client,
|
||||||
uuid=args.uuid,
|
uuid=args.uuid,
|
||||||
lvs_name=args.lvs_name))
|
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('-u', '--uuid', help='lvol store UUID', required=False)
|
||||||
p.add_argument('-l', '--lvs-name', help='lvol store name', 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):
|
def get_raid_bdevs(args):
|
||||||
print_array(rpc.bdev.get_raid_bdevs(args.client,
|
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)
|
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.
|
"""List logical volume stores.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -214,4 +215,4 @@ def get_lvol_stores(client, uuid=None, lvs_name=None):
|
|||||||
params['uuid'] = uuid
|
params['uuid'] = uuid
|
||||||
if lvs_name:
|
if lvs_name:
|
||||||
params['lvs_name'] = 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):
|
def refresh(self):
|
||||||
self._children = set([])
|
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)
|
UILvsObj(lvs, self)
|
||||||
|
|
||||||
def delete(self, name, uuid):
|
def delete(self, name, uuid):
|
||||||
|
@ -190,9 +190,9 @@ class UIRoot(UINode):
|
|||||||
|
|
||||||
@verbose
|
@verbose
|
||||||
@is_method_available
|
@is_method_available
|
||||||
def get_lvol_stores(self):
|
def bdev_lvol_get_lvstores(self):
|
||||||
if self.is_init:
|
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:
|
for lvs in self.current_lvol_stores:
|
||||||
yield LvolStore(lvs)
|
yield LvolStore(lvs)
|
||||||
|
|
||||||
|
@ -778,7 +778,7 @@ function fio_nvme()
|
|||||||
function get_lvs_free_mb()
|
function get_lvs_free_mb()
|
||||||
{
|
{
|
||||||
local lvs_uuid=$1
|
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 fc=$(jq ".[] | select(.uuid==\"$lvs_uuid\") .free_clusters" <<< "$lvs_info")
|
||||||
local cs=$(jq ".[] | select(.uuid==\"$lvs_uuid\") .cluster_size" <<< "$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))
|
json_value=json_value))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def check_get_lvol_stores(self, base_name, uuid, cluster_size=None, lvs_name=""):
|
def check_bdev_lvol_get_lvstores(self, base_name, uuid, cluster_size=None, lvs_name=""):
|
||||||
print("INFO: RPC COMMAND get_lvol_stores")
|
print("INFO: RPC COMMAND bdev_lvol_get_lvstores")
|
||||||
json_value = self.get_lvol_stores()
|
json_value = self.bdev_lvol_get_lvstores()
|
||||||
if json_value:
|
if json_value:
|
||||||
for i in range(len(json_value)):
|
for i in range(len(json_value)):
|
||||||
json_uuid = json_value[i]['uuid']
|
json_uuid = json_value[i]['uuid']
|
||||||
@ -75,14 +75,14 @@ class Commands_Rpc(object):
|
|||||||
if base_name in json_base_name \
|
if base_name in json_base_name \
|
||||||
and uuid in json_uuid:
|
and uuid in json_uuid:
|
||||||
print("INFO: base_name:{base_name} is found in RPC "
|
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))
|
"response".format(base_name=base_name))
|
||||||
print("INFO: UUID:{uuid} is found in RPC Command: "
|
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 cluster_size:
|
||||||
if str(cluster_size) in str(json_cluster):
|
if str(cluster_size) in str(json_cluster):
|
||||||
print("Info: Cluster size :{cluster_size} is found in RPC "
|
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))
|
"response".format(cluster_size=cluster_size))
|
||||||
else:
|
else:
|
||||||
print("ERROR: Wrong cluster size in lvol store")
|
print("ERROR: Wrong cluster size in lvol store")
|
||||||
@ -99,8 +99,8 @@ class Commands_Rpc(object):
|
|||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
print("FAILED: UUID: lvol store {uuid} on base_bdev: "
|
print("FAILED: UUID: lvol store {uuid} on base_bdev: "
|
||||||
"{base_name} not found in get_lvol_stores()".format(uuid=uuid,
|
"{base_name} not found in bdev_lvol_get_lvstores()".format(uuid=uuid,
|
||||||
base_name=base_name))
|
base_name=base_name))
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
print("INFO: Lvol store not exist")
|
print("INFO: Lvol store not exist")
|
||||||
@ -179,12 +179,12 @@ class Commands_Rpc(object):
|
|||||||
output, rc = self.rpc.stop_nbd_disk(nbd_name)
|
output, rc = self.rpc.stop_nbd_disk(nbd_name)
|
||||||
return rc
|
return rc
|
||||||
|
|
||||||
def get_lvol_stores(self, name=None):
|
def bdev_lvol_get_lvstores(self, name=None):
|
||||||
print("INFO: RPC COMMAND get_lvol_stores")
|
print("INFO: RPC COMMAND bdev_lvol_get_lvstores")
|
||||||
if name:
|
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:
|
else:
|
||||||
output = json.loads(self.rpc.get_lvol_stores()[0])
|
output = json.loads(self.rpc.bdev_lvol_get_lvstores()[0])
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def get_lvol_bdevs(self):
|
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)
|
bdev_info=$($rpc_py get_bdevs)
|
||||||
notice "Configuration after initial set-up:"
|
notice "Configuration after initial set-up:"
|
||||||
$rpc_py get_lvol_stores
|
$rpc_py bdev_lvol_get_lvstores
|
||||||
echo "$bdev_info"
|
echo "$bdev_info"
|
||||||
|
|
||||||
# Set up VMs
|
# Set up VMs
|
||||||
@ -277,7 +277,7 @@ fi
|
|||||||
|
|
||||||
clean_lvol_cfg
|
clean_lvol_cfg
|
||||||
|
|
||||||
$rpc_py get_lvol_stores
|
$rpc_py bdev_lvol_get_lvstores
|
||||||
$rpc_py get_bdevs
|
$rpc_py get_bdevs
|
||||||
$rpc_py get_vhost_controllers
|
$rpc_py get_vhost_controllers
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user