From 134dce26692cb95dc8aacad61b059dab128b6f5b Mon Sep 17 00:00:00 2001 From: Cunyin Chang Date: Mon, 17 Oct 2016 16:30:26 +0800 Subject: [PATCH] rpc: Rename construct_malloc_lun to construct_malloc_bdev Change-Id: I72f21881264226499a9cd64c72f3ab1b4808b2ec Signed-off-by: Cunyin Chang --- lib/bdev/malloc/blockdev_malloc_rpc.c | 8 ++++---- scripts/rpc.py | 12 ++++++------ test/iscsi_tgt/calsoft/calsoft.sh | 4 ++-- test/iscsi_tgt/filesystem/filesystem.sh | 4 ++-- test/iscsi_tgt/fio/fio.sh | 4 ++-- test/iscsi_tgt/idle_migration/build_configuration.sh | 2 +- test/iscsi_tgt/reset/reset.sh | 4 ++-- test/iscsi_tgt/rpc_config/rpc_config.py | 10 +++++----- test/iscsi_tgt/rpc_config/rpc_config.sh | 2 +- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/bdev/malloc/blockdev_malloc_rpc.c b/lib/bdev/malloc/blockdev_malloc_rpc.c index 1155744e8a..59a9a9799e 100644 --- a/lib/bdev/malloc/blockdev_malloc_rpc.c +++ b/lib/bdev/malloc/blockdev_malloc_rpc.c @@ -46,9 +46,9 @@ static const struct spdk_json_object_decoder rpc_construct_malloc_decoders[] = { }; static void -spdk_rpc_construct_malloc_lun(struct spdk_jsonrpc_server_conn *conn, - const struct spdk_json_val *params, - const struct spdk_json_val *id) +spdk_rpc_construct_malloc_bdev(struct spdk_jsonrpc_server_conn *conn, + const struct spdk_json_val *params, + const struct spdk_json_val *id) { struct rpc_construct_malloc req = {}; struct spdk_json_write_ctx *w; @@ -76,4 +76,4 @@ spdk_rpc_construct_malloc_lun(struct spdk_jsonrpc_server_conn *conn, invalid: spdk_jsonrpc_send_error_response(conn, id, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid parameters"); } -SPDK_RPC_REGISTER("construct_malloc_lun", spdk_rpc_construct_malloc_lun) +SPDK_RPC_REGISTER("construct_malloc_bdev", spdk_rpc_construct_malloc_bdev) diff --git a/scripts/rpc.py b/scripts/rpc.py index 2c888f9b72..f5b2a67624 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -143,15 +143,15 @@ p.add_argument('chap_auth_group', help="""Authentication group ID for this targe p.set_defaults(func=construct_target_node) -def construct_malloc_lun(args): +def construct_malloc_bdev(args): num_blocks = (args.total_size * 1024 * 1024) / args.block_size params = {'num_blocks': num_blocks, 'block_size': args.block_size} - jsonrpc_call('construct_malloc_lun', params) + jsonrpc_call('construct_malloc_bdev', params) -p = subparsers.add_parser('construct_malloc_lun', help='Add a LUN with malloc backend') -p.add_argument('total_size', help='Size of malloc LUN in MB (int > 0)', type=int) -p.add_argument('block_size', help='Block size for this LUN', type=int) -p.set_defaults(func=construct_malloc_lun) +p = subparsers.add_parser('construct_malloc_bdev', help='Add a bdev with malloc backend') +p.add_argument('total_size', help='Size of malloc bdev in MB (int > 0)', type=int) +p.add_argument('block_size', help='Block size for this bdev', type=int) +p.set_defaults(func=construct_malloc_bdev) def construct_aio_lun(args): diff --git a/test/iscsi_tgt/calsoft/calsoft.sh b/test/iscsi_tgt/calsoft/calsoft.sh index fab542c86d..13c2b26150 100755 --- a/test/iscsi_tgt/calsoft/calsoft.sh +++ b/test/iscsi_tgt/calsoft/calsoft.sh @@ -20,7 +20,7 @@ RPC_PORT=5260 INITIATOR_TAG=2 INITIATOR_NAME=ALL NETMASK=$INITIATOR_IP/32 -MALLOC_LUN_SIZE=64 +MALLOC_BDEV_SIZE=64 MALLOC_BLOCK_SIZE=512 rpc_py="python $rootdir/scripts/rpc.py" @@ -42,7 +42,7 @@ echo "iscsi_tgt is listening. Running tests..." $rpc_py add_portal_group 1 $TARGET_IP:$PORT $rpc_py add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK -$rpc_py construct_malloc_lun $MALLOC_LUN_SIZE $MALLOC_BLOCK_SIZE +$rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "Malloc0:0" ==> use Malloc0 blockdev for LUN0 # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 diff --git a/test/iscsi_tgt/filesystem/filesystem.sh b/test/iscsi_tgt/filesystem/filesystem.sh index c99abf8f36..185eb34ac6 100755 --- a/test/iscsi_tgt/filesystem/filesystem.sh +++ b/test/iscsi_tgt/filesystem/filesystem.sh @@ -22,7 +22,7 @@ RPC_PORT=5260 INITIATOR_TAG=2 INITIATOR_NAME=ALL NETMASK=$INITIATOR_IP/32 -MALLOC_LUN_SIZE=256 +MALLOC_BDEV_SIZE=256 MALLOC_BLOCK_SIZE=512 rpc_py="python $rootdir/scripts/rpc.py" @@ -38,7 +38,7 @@ echo "iscsi_tgt is listening. Running tests..." $rpc_py add_portal_group 1 $TARGET_IP:$PORT $rpc_py add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK -$rpc_py construct_malloc_lun $MALLOC_LUN_SIZE $MALLOC_BLOCK_SIZE +$rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "Malloc0:0" ==> use Malloc0 blockdev for LUN0 # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 diff --git a/test/iscsi_tgt/fio/fio.sh b/test/iscsi_tgt/fio/fio.sh index f10280be0c..67a9a9c8f7 100755 --- a/test/iscsi_tgt/fio/fio.sh +++ b/test/iscsi_tgt/fio/fio.sh @@ -44,7 +44,7 @@ RPC_PORT=5260 INITIATOR_TAG=2 INITIATOR_NAME=ALL NETMASK=$INITIATOR_IP/32 -MALLOC_LUN_SIZE=64 +MALLOC_BDEV_SIZE=64 MALLOC_BLOCK_SIZE=4096 rpc_py="python $rootdir/scripts/rpc.py" @@ -61,7 +61,7 @@ echo "iscsi_tgt is listening. Running tests..." $rpc_py add_portal_group 1 $TARGET_IP:$PORT $rpc_py add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK -$rpc_py construct_malloc_lun $MALLOC_LUN_SIZE $MALLOC_BLOCK_SIZE +$rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "Malloc0:0" ==> use Malloc0 blockdev for LUN0 # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 diff --git a/test/iscsi_tgt/idle_migration/build_configuration.sh b/test/iscsi_tgt/idle_migration/build_configuration.sh index bc96b00777..460925def6 100755 --- a/test/iscsi_tgt/idle_migration/build_configuration.sh +++ b/test/iscsi_tgt/idle_migration/build_configuration.sh @@ -9,6 +9,6 @@ rpc_py=$rootdir/scripts/rpc.py "$rpc_py" add_portal_group 1 '127.0.0.1:3260' for i in $(seq 0 15); do - "$rpc_py" construct_malloc_lun 32 512 + "$rpc_py" construct_malloc_bdev 32 512 "$rpc_py" construct_target_node "Target$i" "Target_alias$i" "Malloc$i:0" "1:1" 64 1 0 0 0 done diff --git a/test/iscsi_tgt/reset/reset.sh b/test/iscsi_tgt/reset/reset.sh index 9ea477f8ac..428de3dd0a 100755 --- a/test/iscsi_tgt/reset/reset.sh +++ b/test/iscsi_tgt/reset/reset.sh @@ -24,7 +24,7 @@ RPC_PORT=5260 INITIATOR_TAG=2 INITIATOR_NAME=ALL NETMASK=$INITIATOR_IP/32 -MALLOC_LUN_SIZE=64 +MALLOC_BDEV_SIZE=64 MALLOC_BLOCK_SIZE=512 rpc_py="python $rootdir/scripts/rpc.py" @@ -45,7 +45,7 @@ echo "iscsi_tgt is listening. Running tests..." $rpc_py add_portal_group 1 $TARGET_IP:$PORT $rpc_py add_initiator_group $INITIATOR_TAG $INITIATOR_NAME $NETMASK -$rpc_py construct_malloc_lun $MALLOC_LUN_SIZE $MALLOC_BLOCK_SIZE +$rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE # "Malloc0:0" ==> use Malloc0 blockdev for LUN0 # "1:2" ==> map PortalGroup1 to InitiatorGroup2 # "64" ==> iSCSI queue depth 64 diff --git a/test/iscsi_tgt/rpc_config/rpc_config.py b/test/iscsi_tgt/rpc_config/rpc_config.py index 67e5436282..4b0cd313cc 100755 --- a/test/iscsi_tgt/rpc_config/rpc_config.py +++ b/test/iscsi_tgt/rpc_config/rpc_config.py @@ -17,7 +17,7 @@ rpc_param = { 'initiator_name': 'ALL', 'netmask': netmask, 'lun_total': 3, - 'malloc_lun_size': 64, + 'malloc_bdev_size': 64, 'malloc_block_size': 512, 'queue_depth': 64, 'target_name': 'Target3', @@ -84,7 +84,7 @@ def verify_iscsi_connection_rpc_methods(rpc_py): portal_tag = '1' initiator_tag = '1' - rpc.construct_malloc_lun(rpc_param['malloc_lun_size'], rpc_param['malloc_block_size']) + rpc.construct_malloc_bdev(rpc_param['malloc_bdev_size'], rpc_param['malloc_block_size']) rpc.add_portal_group(portal_tag, "{}:{}".format(rpc_param['target_ip'], str(rpc_param['port']))) rpc.add_initiator_group(initiator_tag, rpc_param['initiator_name'], rpc_param['netmask'][0]) @@ -127,7 +127,7 @@ def verify_scsi_devices_rpc_methods(rpc_py): portal_tag = '1' initiator_tag = '1' - rpc.construct_malloc_lun(rpc_param['malloc_lun_size'], rpc_param['malloc_block_size']) + rpc.construct_malloc_bdev(rpc_param['malloc_bdev_size'], rpc_param['malloc_block_size']) rpc.add_portal_group(portal_tag, "{}:{}".format(rpc_param['target_ip'], str(rpc_param['port']))) rpc.add_initiator_group(initiator_tag, rpc_param['initiator_name'], rpc_param['netmask'][0]) @@ -166,7 +166,7 @@ def verify_luns_rpc_methods(rpc_py, rpc_param): "get_luns returned {}, expected empty".format(jsonvalue)) for i in range(1, rpc_param['lun_total'] + 1): - rpc.construct_malloc_lun(rpc_param['malloc_lun_size'], rpc_param['malloc_block_size']) + rpc.construct_malloc_bdev(rpc_param['malloc_bdev_size'], rpc_param['malloc_block_size']) output = rpc.get_luns() jsonvalue = json.loads(output) verify(not jsonvalue, 1, @@ -283,7 +283,7 @@ def verify_target_nodes_rpc_methods(rpc_py, rpc_param): verify(not jsonvalues, 1, "get_target_nodes returned {}, expected empty".format(jsonvalues)) - rpc.construct_malloc_lun(rpc_param['malloc_lun_size'], rpc_param['malloc_block_size']) + rpc.construct_malloc_bdev(rpc_param['malloc_bdev_size'], rpc_param['malloc_block_size']) rpc.add_portal_group(portal_tag, "{}:{}".format(rpc_param['target_ip'], str(rpc_param['port']))) rpc.add_initiator_group(initiator_tag, rpc_param['initiator_name'], rpc_param['netmask'][0]) diff --git a/test/iscsi_tgt/rpc_config/rpc_config.sh b/test/iscsi_tgt/rpc_config/rpc_config.sh index 361af8735f..e3faab353e 100755 --- a/test/iscsi_tgt/rpc_config/rpc_config.sh +++ b/test/iscsi_tgt/rpc_config/rpc_config.sh @@ -22,7 +22,7 @@ RPC_PORT=5260 INITIATOR_TAG=2 INITIATOR_NAME=ALL NETMASK=$INITIATOR_IP/32 -MALLOC_LUN_SIZE=64 +MALLOC_BDEV_SIZE=64 rpc_py=$rootdir/scripts/rpc.py