module/compress: rename set_compress_pmd RPC to match convention
set_compress_pmd -> compress_set_pmd Signed-off-by: paul luse <paul.e.luse@intel.com> Change-Id: Icb1ecc7adfe10485c44f98ab9e31eaa6857596e7 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/482597 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
15d92f6a12
commit
e914958951
@ -164,7 +164,7 @@ a value of 1 tells the driver to use QAT and if not available then the creation
|
||||
the vbdev should fail to create or load. A value of '2' as shown below tells the module
|
||||
to use ISAL and if for some reason it is not available, the vbdev should fail to create or load.
|
||||
|
||||
`rpc.py set_compress_pmd -p 2`
|
||||
`rpc.py compress_set_pmd -p 2`
|
||||
|
||||
To remove a compression vbdev, use the following command which will also delete the PMEM
|
||||
file. If the logical volume is deleted the PMEM file will not be removed and the
|
||||
|
@ -1741,7 +1741,7 @@ vbdev_compress_examine(struct spdk_bdev *bdev)
|
||||
}
|
||||
|
||||
int
|
||||
set_compress_pmd(enum compress_pmd *opts)
|
||||
compress_set_pmd(enum compress_pmd *opts)
|
||||
{
|
||||
g_opts = *opts;
|
||||
|
||||
|
@ -76,7 +76,7 @@ enum compress_pmd {
|
||||
COMPRESS_PMD_MAX
|
||||
};
|
||||
|
||||
int set_compress_pmd(enum compress_pmd *opts);
|
||||
int compress_set_pmd(enum compress_pmd *opts);
|
||||
|
||||
typedef void (*spdk_delete_compress_complete)(void *cb_arg, int bdeverrno);
|
||||
|
||||
|
@ -98,19 +98,19 @@ spdk_rpc_bdev_compress_get_orphans(struct spdk_jsonrpc_request *request,
|
||||
}
|
||||
SPDK_RPC_REGISTER("bdev_compress_get_orphans", spdk_rpc_bdev_compress_get_orphans, SPDK_RPC_RUNTIME)
|
||||
|
||||
struct rpc_set_compress_pmd {
|
||||
struct rpc_compress_set_pmd {
|
||||
enum compress_pmd pmd;
|
||||
};
|
||||
|
||||
static const struct spdk_json_object_decoder rpc_compress_pmd_decoder[] = {
|
||||
{"pmd", offsetof(struct rpc_set_compress_pmd, pmd), spdk_json_decode_int32},
|
||||
{"pmd", offsetof(struct rpc_compress_set_pmd, pmd), spdk_json_decode_int32},
|
||||
};
|
||||
|
||||
static void
|
||||
spdk_rpc_set_compress_pmd(struct spdk_jsonrpc_request *request,
|
||||
spdk_rpc_compress_set_pmd(struct spdk_jsonrpc_request *request,
|
||||
const struct spdk_json_val *params)
|
||||
{
|
||||
struct rpc_set_compress_pmd req;
|
||||
struct rpc_compress_set_pmd req;
|
||||
struct spdk_json_write_ctx *w;
|
||||
int rc = 0;
|
||||
|
||||
@ -129,7 +129,7 @@ spdk_rpc_set_compress_pmd(struct spdk_jsonrpc_request *request,
|
||||
return;
|
||||
}
|
||||
|
||||
rc = set_compress_pmd(&req.pmd);
|
||||
rc = compress_set_pmd(&req.pmd);
|
||||
if (rc) {
|
||||
spdk_jsonrpc_send_error_response(request, rc, spdk_strerror(-rc));
|
||||
return;
|
||||
@ -141,8 +141,9 @@ spdk_rpc_set_compress_pmd(struct spdk_jsonrpc_request *request,
|
||||
spdk_jsonrpc_end_result(request, w);
|
||||
}
|
||||
}
|
||||
SPDK_RPC_REGISTER("set_compress_pmd", spdk_rpc_set_compress_pmd,
|
||||
SPDK_RPC_REGISTER("compress_set_pmd", spdk_rpc_compress_set_pmd,
|
||||
SPDK_RPC_STARTUP | SPDK_RPC_RUNTIME)
|
||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(compress_set_pmd, set_compress_pmd)
|
||||
|
||||
/* Structure to hold the parameters for this RPC method. */
|
||||
struct rpc_construct_compress {
|
||||
|
@ -174,12 +174,13 @@ if __name__ == "__main__":
|
||||
p.add_argument('name', help='compress bdev name')
|
||||
p.set_defaults(func=bdev_compress_delete)
|
||||
|
||||
def set_compress_pmd(args):
|
||||
rpc.bdev.set_compress_pmd(args.client,
|
||||
def compress_set_pmd(args):
|
||||
rpc.bdev.compress_set_pmd(args.client,
|
||||
pmd=args.pmd)
|
||||
p = subparsers.add_parser('set_compress_pmd', help='Set pmd option for a compress disk')
|
||||
p = subparsers.add_parser('compress_set_pmd', aliases=['set_compress_pmd'],
|
||||
help='Set pmd option for a compress disk')
|
||||
p.add_argument('-p', '--pmd', type=int, help='0 = auto-select, 1= QAT only, 2 = ISAL only')
|
||||
p.set_defaults(func=set_compress_pmd)
|
||||
p.set_defaults(func=compress_set_pmd)
|
||||
|
||||
def bdev_compress_get_orphans(args):
|
||||
print_dict(rpc.bdev.bdev_compress_get_orphans(args.client,
|
||||
|
@ -46,7 +46,8 @@ def bdev_compress_delete(client, name):
|
||||
return client.call('bdev_compress_delete', params)
|
||||
|
||||
|
||||
def set_compress_pmd(client, pmd):
|
||||
@deprecated_alias('set_compress_pmd')
|
||||
def compress_set_pmd(client, pmd):
|
||||
"""Set pmd options for the bdev compress.
|
||||
|
||||
Args:
|
||||
@ -54,7 +55,7 @@ def set_compress_pmd(client, pmd):
|
||||
"""
|
||||
params = {'pmd': pmd}
|
||||
|
||||
return client.call('set_compress_pmd', params)
|
||||
return client.call('compress_set_pmd', params)
|
||||
|
||||
|
||||
def bdev_compress_get_orphans(client, name=None):
|
||||
|
@ -38,13 +38,13 @@ function create_vols() {
|
||||
|
||||
# use QAT for lv0, if the test system does not have QAT this will
|
||||
# fail which is what we want
|
||||
$rpc_py set_compress_pmd -p 1
|
||||
$rpc_py compress_set_pmd -p 1
|
||||
$rpc_py bdev_compress_create -b lvs0/lv0 -p /tmp/pmem
|
||||
waitforbdev COMP_lvs0/lv0
|
||||
|
||||
# use ISAL for lv1, if ISAL is for some reason not available this will
|
||||
# fail which is what we want
|
||||
$rpc_py set_compress_pmd -p 2
|
||||
$rpc_py compress_set_pmd -p 2
|
||||
$rpc_py bdev_compress_create -b lvs0/lv1 -p /tmp/pmem
|
||||
waitforbdev COMP_lvs0/lv1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user