rpc: Rename add_pg_ig_maps to iscsi_target_node_add_pg_ig_maps
Change-Id: Ie738991ef27f836a0027e64281cbda1599439240 Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467605 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
parent
8fb1cf2f18
commit
a1c9546f1a
@ -82,7 +82,7 @@ In addition to the configuration file, the iSCSI target may also be configured v
|
|||||||
|
|
||||||
- iscsi_create_portal_group -- Add a portal group.
|
- iscsi_create_portal_group -- Add a portal group.
|
||||||
- iscsi_delete_portal_group -- Delete an existing portal group.
|
- iscsi_delete_portal_group -- Delete an existing portal group.
|
||||||
- add_pg_ig_maps -- Add initiator group to portal group mappings to an existing iSCSI target node.
|
- iscsi_target_node_add_pg_ig_maps -- Add initiator group to portal group mappings to an existing iSCSI target node.
|
||||||
- delete_pg_ig_maps -- Delete initiator group to portal group mappings from an existing iSCSI target node.
|
- delete_pg_ig_maps -- Delete initiator group to portal group mappings from an existing iSCSI target node.
|
||||||
- iscsi_get_portal_groups -- Show information about all available portal groups.
|
- iscsi_get_portal_groups -- Show information about all available portal groups.
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ Example response:
|
|||||||
"iscsi_get_portal_groups",
|
"iscsi_get_portal_groups",
|
||||||
"delete_target_node",
|
"delete_target_node",
|
||||||
"delete_pg_ig_maps",
|
"delete_pg_ig_maps",
|
||||||
"add_pg_ig_maps",
|
"iscsi_target_node_add_pg_ig_maps",
|
||||||
"iscsi_create_target_node",
|
"iscsi_create_target_node",
|
||||||
"iscsi_get_target_nodes",
|
"iscsi_get_target_nodes",
|
||||||
"delete_initiator_group",
|
"delete_initiator_group",
|
||||||
@ -3275,7 +3275,7 @@ Example response:
|
|||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
## add_pg_ig_maps method {#rpc_add_pg_ig_maps}
|
## iscsi_target_node_add_pg_ig_maps method {#rpc_iscsi_target_node_add_pg_ig_maps}
|
||||||
|
|
||||||
Add initiator group to portal group mappings to an existing iSCSI target node.
|
Add initiator group to portal group mappings to an existing iSCSI target node.
|
||||||
|
|
||||||
@ -3317,7 +3317,7 @@ Example request:
|
|||||||
"name": "iqn.2016-06.io.spdk:target3"
|
"name": "iqn.2016-06.io.spdk:target3"
|
||||||
},
|
},
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"method": "add_pg_ig_maps",
|
"method": "iscsi_target_node_add_pg_ig_maps",
|
||||||
"id": 1
|
"id": 1
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
@ -516,8 +516,8 @@ static const struct spdk_json_object_decoder rpc_tgt_node_pg_ig_maps_decoders[]
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_rpc_add_pg_ig_maps(struct spdk_jsonrpc_request *request,
|
spdk_rpc_iscsi_target_node_add_pg_ig_maps(struct spdk_jsonrpc_request *request,
|
||||||
const struct spdk_json_val *params)
|
const struct spdk_json_val *params)
|
||||||
{
|
{
|
||||||
struct rpc_tgt_node_pg_ig_maps req = {};
|
struct rpc_tgt_node_pg_ig_maps req = {};
|
||||||
struct spdk_json_write_ctx *w;
|
struct spdk_json_write_ctx *w;
|
||||||
@ -544,8 +544,8 @@ spdk_rpc_add_pg_ig_maps(struct spdk_jsonrpc_request *request,
|
|||||||
ig_tags[i] = req.pg_ig_maps.maps[i].ig_tag;
|
ig_tags[i] = req.pg_ig_maps.maps[i].ig_tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = spdk_iscsi_tgt_node_add_pg_ig_maps(target, pg_tags, ig_tags,
|
rc = spdk_iscsi_target_node_add_pg_ig_maps(target, pg_tags, ig_tags,
|
||||||
req.pg_ig_maps.num_maps);
|
req.pg_ig_maps.num_maps);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
SPDK_ERRLOG("add pg-ig maps failed\n");
|
SPDK_ERRLOG("add pg-ig maps failed\n");
|
||||||
goto invalid;
|
goto invalid;
|
||||||
@ -563,7 +563,9 @@ invalid:
|
|||||||
"Invalid parameters");
|
"Invalid parameters");
|
||||||
free(req.name);
|
free(req.name);
|
||||||
}
|
}
|
||||||
SPDK_RPC_REGISTER("add_pg_ig_maps", spdk_rpc_add_pg_ig_maps, SPDK_RPC_RUNTIME)
|
SPDK_RPC_REGISTER("iscsi_target_node_add_pg_ig_maps",
|
||||||
|
spdk_rpc_iscsi_target_node_add_pg_ig_maps, SPDK_RPC_RUNTIME)
|
||||||
|
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(iscsi_target_node_add_pg_ig_maps, add_pg_ig_maps)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_rpc_delete_pg_ig_maps(struct spdk_jsonrpc_request *request,
|
spdk_rpc_delete_pg_ig_maps(struct spdk_jsonrpc_request *request,
|
||||||
|
@ -787,8 +787,8 @@ failed:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
spdk_iscsi_tgt_node_add_pg_ig_maps(struct spdk_iscsi_tgt_node *target,
|
spdk_iscsi_target_node_add_pg_ig_maps(struct spdk_iscsi_tgt_node *target,
|
||||||
int *pg_tag_list, int *ig_tag_list, uint16_t num_maps)
|
int *pg_tag_list, int *ig_tag_list, uint16_t num_maps)
|
||||||
{
|
{
|
||||||
uint16_t i;
|
uint16_t i;
|
||||||
int rc;
|
int rc;
|
||||||
@ -993,7 +993,8 @@ spdk_iscsi_tgt_node_construct(int target_index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TAILQ_INIT(&target->pg_map_head);
|
TAILQ_INIT(&target->pg_map_head);
|
||||||
rc = spdk_iscsi_tgt_node_add_pg_ig_maps(target, pg_tag_list, ig_tag_list, num_maps);
|
rc = spdk_iscsi_target_node_add_pg_ig_maps(target, pg_tag_list,
|
||||||
|
ig_tag_list, num_maps);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
SPDK_ERRLOG("could not add map to target\n");
|
SPDK_ERRLOG("could not add map to target\n");
|
||||||
iscsi_tgt_node_destruct(target, NULL, NULL);
|
iscsi_tgt_node_destruct(target, NULL, NULL);
|
||||||
|
@ -127,9 +127,9 @@ spdk_iscsi_tgt_node_construct(int target_index,
|
|||||||
|
|
||||||
bool spdk_iscsi_check_chap_params(bool disable, bool require, bool mutual, int group);
|
bool spdk_iscsi_check_chap_params(bool disable, bool require, bool mutual, int group);
|
||||||
|
|
||||||
int spdk_iscsi_tgt_node_add_pg_ig_maps(struct spdk_iscsi_tgt_node *target,
|
int spdk_iscsi_target_node_add_pg_ig_maps(struct spdk_iscsi_tgt_node *target,
|
||||||
int *pg_tag_list, int *ig_tag_list,
|
int *pg_tag_list, int *ig_tag_list,
|
||||||
uint16_t num_maps);
|
uint16_t num_maps);
|
||||||
int spdk_iscsi_tgt_node_delete_pg_ig_maps(struct spdk_iscsi_tgt_node *target,
|
int spdk_iscsi_tgt_node_delete_pg_ig_maps(struct spdk_iscsi_tgt_node *target,
|
||||||
int *pg_tag_list, int *ig_tag_list,
|
int *pg_tag_list, int *ig_tag_list,
|
||||||
uint16_t num_maps);
|
uint16_t num_maps);
|
||||||
|
@ -903,24 +903,26 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
|
|||||||
action='store_true')
|
action='store_true')
|
||||||
p.set_defaults(func=iscsi_target_node_set_auth)
|
p.set_defaults(func=iscsi_target_node_set_auth)
|
||||||
|
|
||||||
def add_pg_ig_maps(args):
|
def iscsi_target_node_add_pg_ig_maps(args):
|
||||||
pg_ig_maps = []
|
pg_ig_maps = []
|
||||||
for u in args.pg_ig_mappings.strip().split(" "):
|
for u in args.pg_ig_mappings.strip().split(" "):
|
||||||
pg, ig = u.split(":")
|
pg, ig = u.split(":")
|
||||||
pg_ig_maps.append({"pg_tag": int(pg), "ig_tag": int(ig)})
|
pg_ig_maps.append({"pg_tag": int(pg), "ig_tag": int(ig)})
|
||||||
rpc.iscsi.add_pg_ig_maps(
|
rpc.iscsi.iscsi_target_node_add_pg_ig_maps(
|
||||||
args.client,
|
args.client,
|
||||||
pg_ig_maps=pg_ig_maps,
|
pg_ig_maps=pg_ig_maps,
|
||||||
name=args.name)
|
name=args.name)
|
||||||
|
|
||||||
p = subparsers.add_parser('add_pg_ig_maps', help='Add PG-IG maps to the target node')
|
p = subparsers.add_parser('iscsi_target_node_add_pg_ig_maps',
|
||||||
|
aliases=['add_pg_ig_maps'],
|
||||||
|
help='Add PG-IG maps to the target node')
|
||||||
p.add_argument('name', help='Target node name (ASCII)')
|
p.add_argument('name', help='Target node name (ASCII)')
|
||||||
p.add_argument('pg_ig_mappings', help="""List of (Portal_Group_Tag:Initiator_Group_Tag) mappings
|
p.add_argument('pg_ig_mappings', help="""List of (Portal_Group_Tag:Initiator_Group_Tag) mappings
|
||||||
Whitespace separated, quoted, mapping defined with colon
|
Whitespace separated, quoted, mapping defined with colon
|
||||||
separated list of "tags" (int > 0)
|
separated list of "tags" (int > 0)
|
||||||
Example: '1:1 2:2 2:1'
|
Example: '1:1 2:2 2:1'
|
||||||
*** The Portal/Initiator Groups must be precreated ***""")
|
*** The Portal/Initiator Groups must be precreated ***""")
|
||||||
p.set_defaults(func=add_pg_ig_maps)
|
p.set_defaults(func=iscsi_target_node_add_pg_ig_maps)
|
||||||
|
|
||||||
def delete_pg_ig_maps(args):
|
def delete_pg_ig_maps(args):
|
||||||
pg_ig_maps = []
|
pg_ig_maps = []
|
||||||
|
@ -348,7 +348,8 @@ def delete_pg_ig_maps(client, pg_ig_maps, name):
|
|||||||
return client.call('delete_pg_ig_maps', params)
|
return client.call('delete_pg_ig_maps', params)
|
||||||
|
|
||||||
|
|
||||||
def add_pg_ig_maps(client, pg_ig_maps, name):
|
@deprecated_alias('add_pg_ig_maps')
|
||||||
|
def iscsi_target_node_add_pg_ig_maps(client, pg_ig_maps, name):
|
||||||
"""Add PG-IG maps to the target node.
|
"""Add PG-IG maps to the target node.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -362,7 +363,7 @@ def add_pg_ig_maps(client, pg_ig_maps, name):
|
|||||||
'name': name,
|
'name': name,
|
||||||
'pg_ig_maps': pg_ig_maps,
|
'pg_ig_maps': pg_ig_maps,
|
||||||
}
|
}
|
||||||
return client.call('add_pg_ig_maps', params)
|
return client.call('iscsi_target_node_add_pg_ig_maps', params)
|
||||||
|
|
||||||
|
|
||||||
@deprecated_alias('add_portal_group')
|
@deprecated_alias('add_portal_group')
|
||||||
|
@ -46,7 +46,7 @@ class UINode(ConfigNode):
|
|||||||
if self.shell.interactive and\
|
if self.shell.interactive and\
|
||||||
command in ["create", "delete", "delete_all", "add_initiator",
|
command in ["create", "delete", "delete_all", "add_initiator",
|
||||||
"allow_any_host", "split_bdev", "add_lun",
|
"allow_any_host", "split_bdev", "add_lun",
|
||||||
"add_pg_ig_maps", "remove_target", "add_secret",
|
"iscsi_target_node_add_pg_ig_maps", "remove_target", "add_secret",
|
||||||
"destruct_split_bdev", "bdev_pmem_delete_pool",
|
"destruct_split_bdev", "bdev_pmem_delete_pool",
|
||||||
"bdev_pmem_create_pool", "delete_secret_all",
|
"bdev_pmem_create_pool", "delete_secret_all",
|
||||||
"delete_initiator", "set_auth", "delete_secret",
|
"delete_initiator", "set_auth", "delete_secret",
|
||||||
|
@ -184,7 +184,7 @@ class UIISCSIDevice(UINode):
|
|||||||
disable_chap=disable_chap,
|
disable_chap=disable_chap,
|
||||||
require_chap=require_chap, mutual_chap=mutual_chap)
|
require_chap=require_chap, mutual_chap=mutual_chap)
|
||||||
|
|
||||||
def ui_command_add_pg_ig_maps(self, pg_ig_mappings):
|
def ui_command_iscsi_target_node_add_pg_ig_maps(self, pg_ig_mappings):
|
||||||
"""Add PG-IG maps to the target node.
|
"""Add PG-IG maps to the target node.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -194,7 +194,7 @@ class UIISCSIDevice(UINode):
|
|||||||
for u in pg_ig_mappings.strip().split(" "):
|
for u in pg_ig_mappings.strip().split(" "):
|
||||||
pg, ig = u.split(":")
|
pg, ig = u.split(":")
|
||||||
pg_ig_maps.append({"pg_tag": int(pg), "ig_tag": int(ig)})
|
pg_ig_maps.append({"pg_tag": int(pg), "ig_tag": int(ig)})
|
||||||
self.get_root().add_pg_ig_maps(
|
self.get_root().iscsi_target_node_add_pg_ig_maps(
|
||||||
pg_ig_maps=pg_ig_maps, name=self.device.device_name)
|
pg_ig_maps=pg_ig_maps, name=self.device.device_name)
|
||||||
|
|
||||||
def ui_command_delete_pg_ig_maps(self, pg_ig_mappings):
|
def ui_command_delete_pg_ig_maps(self, pg_ig_mappings):
|
||||||
|
@ -436,8 +436,8 @@ class UIRoot(UINode):
|
|||||||
rpc.iscsi.iscsi_initiator_group_remove_initiators(self.client, **kwargs)
|
rpc.iscsi.iscsi_initiator_group_remove_initiators(self.client, **kwargs)
|
||||||
|
|
||||||
@verbose
|
@verbose
|
||||||
def add_pg_ig_maps(self, **kwargs):
|
def iscsi_target_node_add_pg_ig_maps(self, **kwargs):
|
||||||
rpc.iscsi.add_pg_ig_maps(self.client, **kwargs)
|
rpc.iscsi.iscsi_target_node_add_pg_ig_maps(self.client, **kwargs)
|
||||||
|
|
||||||
@verbose
|
@verbose
|
||||||
def delete_pg_ig_maps(self, **kwargs):
|
def delete_pg_ig_maps(self, **kwargs):
|
||||||
|
@ -34,7 +34,7 @@ $spdkcli_job "'/bdevs/malloc create 32 512 Malloc0' 'Malloc0' True
|
|||||||
'/iscsi/initiator_groups add_initiator 2 ANW 10.0.2.16/32' 'hostname=ANW, netmask=10.0.2.16' True
|
'/iscsi/initiator_groups add_initiator 2 ANW 10.0.2.16/32' 'hostname=ANW, netmask=10.0.2.16' True
|
||||||
'/iscsi/target_nodes create Target0 Target0_alias \"Malloc0:0 Malloc1:1\" 1:2 64 g=1' 'Target0' True
|
'/iscsi/target_nodes create Target0 Target0_alias \"Malloc0:0 Malloc1:1\" 1:2 64 g=1' 'Target0' True
|
||||||
'/iscsi/target_nodes create Target1 Target1_alias Malloc2:0 1:2 64 g=1' 'Target1' True
|
'/iscsi/target_nodes create Target1 Target1_alias Malloc2:0 1:2 64 g=1' 'Target1' True
|
||||||
'/iscsi/target_nodes/iqn.2016-06.io.spdk:Target0 add_pg_ig_maps \"1:3 2:2\"' 'portal_group1 - initiator_group3' True
|
'/iscsi/target_nodes/iqn.2016-06.io.spdk:Target0 iscsi_target_node_add_pg_ig_maps \"1:3 2:2\"' 'portal_group1 - initiator_group3' True
|
||||||
'/iscsi/target_nodes add_lun iqn.2016-06.io.spdk:Target1 Malloc3 2' 'Malloc3' True
|
'/iscsi/target_nodes add_lun iqn.2016-06.io.spdk:Target1 Malloc3 2' 'Malloc3' True
|
||||||
'/iscsi/auth_groups create 1 \"user:test1 secret:test1 muser:mutual_test1 msecret:mutual_test1,\
|
'/iscsi/auth_groups create 1 \"user:test1 secret:test1 muser:mutual_test1 msecret:mutual_test1,\
|
||||||
user:test3 secret:test3 muser:mutual_test3 msecret:mutual_test3\"' 'user=test3' True
|
user:test3 secret:test3 muser:mutual_test3 msecret:mutual_test3\"' 'user=test3' True
|
||||||
|
Loading…
Reference in New Issue
Block a user