Merged revisions 3713 via svnmerge from

https://vlnb@scst.svn.sourceforge.net/svnroot/scst/trunk

........
  r3713 | bvassche | 2011-07-21 11:42:58 -0400 (Thu, 21 Jul 2011) | 1 line
  
  scst/ALUA: Support use of the "create" verb next to "add" to create device groups and target groups
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.1.0.x@3778 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2011-07-27 01:29:41 +00:00
parent 189fef8e15
commit 51d09c6fe8
2 changed files with 10 additions and 10 deletions

View File

@@ -1237,32 +1237,32 @@ other_tgt_id=2
cd /sys/kernel/scst_tgt/device_groups
echo del dgroup1 >mgmt
echo del dgroup2 >mgmt
echo add dgroup1 >mgmt
echo create dgroup1 >mgmt
echo add disk01 >dgroup1/devices/mgmt
echo add tgroup1 >dgroup1/target_groups/mgmt
echo create tgroup1 >dgroup1/target_groups/mgmt
echo ${own_tgt_id} >dgroup1/target_groups/tgroup1/group_id
echo add ib_srpt_0 >dgroup1/target_groups/tgroup1/mgmt
echo ${own_tgt_id} >dgroup1/target_groups/tgroup1/ib_srpt_0/rel_tgt_id
if [ ${own_tgt_id} = 1 ]; then
echo 1 >dgroup1/target_groups/tgroup1/preferred
fi
echo add tgroup2 >dgroup1/target_groups/mgmt
echo create tgroup2 >dgroup1/target_groups/mgmt
echo ${other_tgt_id} >dgroup1/target_groups/tgroup2/group_id
echo add ib_srpt_0-other >dgroup1/target_groups/tgroup2/mgmt
echo ${other_tgt_id} >dgroup1/target_groups/tgroup2/ib_srpt_0-other/rel_tgt_id
if [ ${other_tgt_id} = 1 ]; then
echo 1 >dgroup1/target_groups/tgroup1/preferred
fi
echo add dgroup2 >mgmt
echo create dgroup2 >mgmt
echo add disk02 >dgroup2/devices/mgmt
echo add tgroup1 >dgroup2/target_groups/mgmt
echo create tgroup1 >dgroup2/target_groups/mgmt
echo ${own_tgt_id} >dgroup2/target_groups/tgroup1/group_id
echo add ib_srpt_0 >dgroup2/target_groups/tgroup1/mgmt
echo ${own_tgt_id} >dgroup2/target_groups/tgroup1/ib_srpt_0/rel_tgt_id
if [ ${own_tgt_id} = 2 ]; then
echo 1 >dgroup2/target_groups/tgroup1/preferred
fi
echo add tgroup2 >dgroup2/target_groups/mgmt
echo create tgroup2 >dgroup2/target_groups/mgmt
echo ${other_tgt_id} >dgroup2/target_groups/tgroup2/group_id
echo add ib_srpt_0-other >dgroup2/target_groups/tgroup2/mgmt
echo ${other_tgt_id} >dgroup2/target_groups/tgroup2/ib_srpt_0-other/rel_tgt_id

View File

@@ -5388,7 +5388,7 @@ static ssize_t scst_dg_tgs_mgmt_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
static const char help[] =
"Usage: echo \"add group_name\" >mgmt\n"
"Usage: echo \"create group_name\" >mgmt\n"
" echo \"del group_name\" >mgmt\n";
return scnprintf(buf, PAGE_SIZE, help);
@@ -5413,7 +5413,7 @@ static int scst_dg_tgs_mgmt_store_work_fn(struct scst_sysfs_work_item *w)
res = -EINVAL;
pp = cmd;
p = scst_get_next_lexem(&pp);
if (strcasecmp(p, "add") == 0) {
if (strcasecmp(p, "create") == 0 || strcasecmp(p, "add") == 0) {
dev_name = scst_get_next_lexem(&pp);
if (!*dev_name)
goto out;
@@ -5526,7 +5526,7 @@ static ssize_t scst_device_groups_mgmt_show(struct kobject *kobj,
char *buf)
{
static const char help[] =
"Usage: echo \"add group_name\" >mgmt\n"
"Usage: echo \"create group_name\" >mgmt\n"
" echo \"del group_name\" >mgmt\n";
return scnprintf(buf, PAGE_SIZE, help);
@@ -5549,7 +5549,7 @@ static ssize_t scst_device_groups_mgmt_store(struct kobject *kobj,
res = -EINVAL;
p = scst_get_next_lexem(&pp);
if (strcasecmp(p, "add") == 0) {
if (strcasecmp(p, "create") == 0 || strcasecmp(p, "add") == 0) {
group_name = scst_get_next_lexem(&pp);
if (!*group_name)
goto out;