rpc: Rename construct_malloc_lun to construct_malloc_bdev
Change-Id: I72f21881264226499a9cd64c72f3ab1b4808b2ec Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
This commit is contained in:
parent
83620f4e09
commit
134dce2669
@ -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)
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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])
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user