From: <bva...@us...> - 2013-10-10 15:02:28
|
Revision: 5056 http://sourceforge.net/p/scst/svn/5056 Author: bvassche Date: 2013-10-10 15:02:25 +0000 (Thu, 10 Oct 2013) Log Message: ----------- scstadmin: Set hardware target attributes correctly For target drivers that support creating targets, e.g. the Emulex FC driver, it is possible that a target attribute is both writable for existing (hardware) targets and that it has to be specified when creating a (virtual) target. Make sure that scstadmin sets these attributes for existing (hardware) targets when restoring a configuration. Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-10-10 14:32:40 UTC (rev 5055) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-10-10 15:02:25 UTC (rev 5056) @@ -2512,7 +2512,9 @@ } my $attributes = configToAttr(\%_attributes); - filterCreateAttributes($possible, $attributes, TRUE); + if ($SCST->targetType($driver, $target) == $SCST::SCST::TGT_TYPE_VIRTUAL) { + filterCreateAttributes($possible, $attributes, TRUE); + } $changes += setTargetAttributes($driver, $target, $attributes, $deletions); foreach my $item (keys %{$$targets{$target}}) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2013-10-10 15:28:08
|
Revision: 5065 http://sourceforge.net/p/scst/svn/5065 Author: bvassche Date: 2013-10-10 15:28:05 +0000 (Thu, 10 Oct 2013) Log Message: ----------- scstadmin: Add command-line option -cont_on_err Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-10-10 15:14:11 UTC (rev 5064) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-10-10 15:28:05 UTC (rev 5065) @@ -211,7 +211,8 @@ -force : Force all configuration changes, even deletions (DANGER!). -noprompt : Do not prompt or pause. Use with caution! - + -cont_on_err : Continue after an error occurred. + Debugging (limited support) -debug : Debug mode - don\'t do anything destructive. @@ -258,6 +259,7 @@ my $CONFIGFILE; my $_DEBUG_; my $_NOPROMPT_; +my $_CONT_ON_ERR_; my %CURRENT; @@ -458,6 +460,7 @@ 'nonkey' => \$nonkey, 'noprompt' => \$_NOPROMPT_, + 'cont_on_err' => \$_CONT_ON_ERR_, 'force' => \$force, 'debug' => \$_DEBUG_)) { @@ -471,6 +474,7 @@ $_DEBUG_ = TRUE if (defined($_DEBUG_)); $_NOPROMPT_ = TRUE if (defined($_NOPROMPT_)); + $_CONT_ON_ERR_ = TRUE if (defined($_CONT_ON_ERR_)); $force = TRUE if (defined($force)); $nonkey = TRUE if (defined($nonkey)); @@ -2017,13 +2021,13 @@ my $attributes = configToAttr(\%_attributes); my $create_attrs = configToAttr(\%_attributes); my $possible = $SCST->deviceCreateAttributes($handler); - immediateExit($SCST->errorString()); + condExit($SCST->errorString()); filterCreateAttributes($possible, $create_attrs, FALSE); filterCreateAttributes($possible, $attributes, TRUE); if (handlerHasDevice($handler, $device)) { my $old_create_attrs = $SCST->deviceAttributes($device); - immediateExit($SCST->errorString()); + condExit($SCST->errorString()); filterCreateAttributes($possible, $old_create_attrs, FALSE); if (compareToKeyAttribute($create_attrs, $old_create_attrs)) { @@ -2103,9 +2107,9 @@ } else { my $c_attrs = configToAttr($$config{'TARGET_DRIVER'}->{$driver}->{'TARGET'}->{$target}->{'LUN'}->{$lun}->{$device}); my $o_attrs = $SCST->lunAttributes($driver, $target, $lun); - immediateExit($SCST->errorString()); + condExit($SCST->errorString()); my $possible = $SCST->lunCreateAttributes($driver, $target); - immediateExit($SCST->errorString()); + condExit($SCST->errorString()); filterCreateAttributes($possible, $c_attrs, FALSE); @@ -2146,9 +2150,9 @@ } else { my $c_attrs = configToAttr($$config{'TARGET_DRIVER'}->{$driver}->{'TARGET'}->{$target}->{'GROUP'}->{$group}->{'LUN'}->{$lun}->{$device}); my $o_attrs = $SCST->lunAttributes($driver, $target, $lun, $group); - immediateExit($SCST->errorString()); + condExit($SCST->errorString()); my $possible = $SCST->lunCreateAttributes($driver, $target, $group); - immediateExit($SCST->errorString()); + condExit($SCST->errorString()); filterCreateAttributes($possible, $c_attrs, FALSE); @@ -2189,7 +2193,7 @@ foreach my $driver (sort keys %{$assignments}) { if (!defined($CURRENT{'assign'}->{$driver})) { - immediateExit("Target driver '$driver' is not loaded or available."); + condExit("Target driver '$driver' is not loaded or available."); } my %_attributes; @@ -2459,7 +2463,7 @@ if ($deletions && $isVirtual) { my $rc = removeVirtualTarget($driver, $target); - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); $changes++; } else { print "\t-> Virtual target '$target' for driver '$driver' is not in configuration. ". @@ -2479,7 +2483,7 @@ foreach my $target (sort keys %{$targets}) { if (!defined($CURRENT{'assign'}->{$driver}->{$target})) { if (!$is_virtual) { - immediateExit("Target '$target' for driver '$driver' does not exist."); + condExit("Target '$target' for driver '$driver' does not exist."); } else { my %_attributes; @@ -2492,13 +2496,13 @@ my $attributes = configToAttr(\%_attributes); if (defined($$attributes{'HW_TARGET'})) { - immediateExit("Hardware target '$target' for driver '$driver' does not exist."); + condExit("Hardware target '$target' for driver '$driver' does not exist."); } filterCreateAttributes($possible, $attributes, FALSE); my $rc = addVirtualTarget($driver, $target, $attributes); - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); $changes++ if (!$rc); } } @@ -4299,7 +4303,7 @@ my $rc = $SCST->addDriverDynamicAttribute($driver, $attribute, $value); print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4338,7 +4342,7 @@ my $rc = $SCST->removeDriverDynamicAttribute($driver, $attribute, $value); print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4360,7 +4364,7 @@ my $rc = $SCST->setTargetAttribute($driver, $target, $attribute, $value); print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4481,7 +4485,7 @@ my $rc = $SCST->addTargetDynamicAttribute($driver, $target, $attribute, $value); print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4523,7 +4527,7 @@ my $rc = $SCST->removeTargetDynamicAttribute($driver, $target, $attribute, $value); print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4541,7 +4545,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4567,7 +4571,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4590,7 +4594,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4605,7 +4609,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4621,7 +4625,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4647,7 +4651,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4673,7 +4677,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4690,7 +4694,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4705,7 +4709,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4740,7 +4744,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4758,7 +4762,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4785,7 +4789,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4819,7 +4823,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4837,7 +4841,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4855,7 +4859,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4871,7 +4875,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4898,7 +4902,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4921,7 +4925,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4941,7 +4945,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4961,7 +4965,7 @@ print "done.\n"; - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); return FALSE; } @@ -4983,7 +4987,7 @@ my $value = $$attributes{$attribute}->{'keys'}->{$key}->{'value'}; my $rc = $SCST->removeDriverDynamicAttribute($driver, $attribute, $value); - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); } } } @@ -5012,7 +5016,7 @@ my $value = $$attributes{$attribute}->{'keys'}->{$key}->{'value'}; my $rc = $SCST->removeTargetDynamicAttribute($driver, $target, $attribute, $value); - immediateExit($SCST->errorString($rc)) if ($rc); + condExit($SCST->errorString($rc)); } } } @@ -5410,7 +5414,7 @@ addAllGroupsToTarget(\%config, \%new, $driver, $target); $has_enabled = TRUE; } else { - immediateExit("Unable to determine target driver information for target '$wwn'. ". + condExit("Unable to determine target driver information for target '$wwn'. ". "Please ensure this target driver is loaded."); } } @@ -5616,6 +5620,19 @@ exit 1; } +# If an error occurred, exit if -cont_on_err has not been specified. +sub condExit { + my $error = shift; + + if (!$error) { + ; + } elsif ($_CONT_ON_ERR_) { + print "$error\n"; + } else { + immediateExit($error); + } +} + sub issueWarning { my $error = shift; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2013-10-24 07:26:40
|
Revision: 5081 http://sourceforge.net/p/scst/svn/5081 Author: bvassche Date: 2013-10-24 07:26:35 +0000 (Thu, 24 Oct 2013) Log Message: ----------- scstadmin: Avoid confusing Emacs' syntax highlighting algorithm Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-10-23 07:38:40 UTC (rev 5080) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-10-24 07:26:35 UTC (rev 5081) @@ -202,7 +202,7 @@ -issue_lip [<t>] [-driver <driver>] : Issue a LIP for a specific driver/target or for all drivers and targets. - -no_lip : Don't automatically issue a LIP after applying + -no_lip : Don\'t automatically issue a LIP after applying configuration changes. Options This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2013-11-13 21:07:23
|
Revision: 5104 http://sourceforge.net/p/scst/svn/5104 Author: bvassche Date: 2013-11-13 21:07:19 +0000 (Wed, 13 Nov 2013) Log Message: ----------- scstadmin: Remove duplicate code Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-11-13 21:06:46 UTC (rev 5103) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-11-13 21:07:19 UTC (rev 5104) @@ -3766,24 +3766,6 @@ return listAttributes($attributes, $nonkey); } -sub listTargetGroupTargetAttributes { - my $group = shift; - my $tgroup = shift; - my $tgt = shift; - my $nonkey = shift; - - my $attributes = $SCST->targetGroupTargetAttributes($group, $tgroup, $tgt); - - return TRUE if issueWarning($SCST->errorString()); - - if (!scalar(keys %{$attributes})) { - print "No such target '$tgt' exists within specified target group.\n"; - return; - } - - return listAttributes($attributes, $nonkey); -} - #################################################################### sub setScstAttribute { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2013-11-14 10:10:40
|
Revision: 5112 http://sourceforge.net/p/scst/svn/5112 Author: bvassche Date: 2013-11-14 10:10:37 +0000 (Thu, 14 Nov 2013) Log Message: ----------- scstadmin: -cont_on_err bug fix Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-11-14 09:14:18 UTC (rev 5111) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2013-11-14 10:10:37 UTC (rev 5112) @@ -765,7 +765,7 @@ defined($applyConfig) && do { $CONFIGFILE = $applyConfig; $rc = checkConfiguration(); - immediateExit("Configuration has errors, aborting.") if ($rc); + condExit("Configuration has errors, aborting.") if ($rc); last if ($force && prompt()); my $changes = applyConfiguration($force); $rc = issueLip() if ($changes && !$noLip); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2014-04-06 20:26:11
|
Revision: 5410 http://sourceforge.net/p/scst/svn/5410 Author: bvassche Date: 2014-04-06 20:26:08 +0000 (Sun, 06 Apr 2014) Log Message: ----------- scstadmin: List keys alphabetically in the -list_sessions output Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2014-04-06 20:13:53 UTC (rev 5409) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2014-04-06 20:26:08 UTC (rev 5410) @@ -3414,11 +3414,11 @@ my $found = FALSE; - foreach my $attribute (keys %{$attributes}) { + foreach my $attribute (sort keys %{$attributes}) { my $first = TRUE; if (defined($$attributes{$attribute}->{'keys'})) { - foreach my $key (keys %{$$attributes{$attribute}->{'keys'}}) { + foreach my $key (sort keys %{$$attributes{$attribute}->{'keys'}}) { my $value = $$attributes{$attribute}->{'keys'}->{$key}->{'value'}; my $static = ($$attributes{$attribute}->{'static'}) ? 'No' : 'Yes'; $value = '<not set>' if ($value eq ''); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2014-09-10 11:42:58
|
Revision: 5793 http://sourceforge.net/p/scst/svn/5793 Author: bvassche Date: 2014-09-10 11:42:54 +0000 (Wed, 10 Sep 2014) Log Message: ----------- scstadmin: Sync saved configuration files Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2014-09-10 10:28:46 UTC (rev 5792) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2014-09-10 11:42:54 UTC (rev 5793) @@ -1751,6 +1751,8 @@ } } + $io->flush; + $io->sync; close $io; return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2015-02-20 10:37:21
|
Revision: 6108 http://sourceforge.net/p/scst/svn/6108 Author: bvassche Date: 2015-02-20 10:37:14 +0000 (Fri, 20 Feb 2015) Log Message: ----------- scstadmin: Correct rem_group and rem_init help text Signed-off-by: Aayush Kasurde <aay...@gm...> Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-02-17 07:21:01 UTC (rev 6107) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-02-20 10:37:14 UTC (rev 6108) @@ -643,14 +643,14 @@ if ((defined($addGroup) || defined($removeGroup)) && (($driver eq '') || ($target eq ''))) { - print "Please specify -driver and -target with -add_group/-remove_group.\n"; + print "Please specify -driver and -target with -add_group/-rem_group.\n"; exit 1; } if ((defined($addInitiator) || defined($removeInitiator) || defined($clearInitiators)) && (($target eq '') || ($driver eq '') || ($group eq ''))) { print "Please specify -driver -target and -group with ". - "-add_init/-remove_init/-clear_inits.\n"; + "-add_init/-rem_init/-clear_inits.\n"; exit 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2015-10-20 15:08:29
|
Revision: 6548 http://sourceforge.net/p/scst/svn/6548 Author: bvassche Date: 2015-10-20 15:08:27 +0000 (Tue, 20 Oct 2015) Log Message: ----------- scstadmin: Fix ALUA help text Signed-off-by: Hiroyuki Sato <hir...@gm...> Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-10-19 17:23:16 UTC (rev 6547) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-10-20 15:08:27 UTC (rev 6548) @@ -72,12 +72,14 @@ -attributes <p=v,...> -set_drv_attr <driver> : Sets driver attribute(s) <p> to value <v>. -attributes <p=v,...> - -set_dgrp_attr <dgrp> : List all attributes for a given device group. + -set_dgrp_attr <dgrp> : Sets device group attribute(s) <p> to value <v>. -attributes <p=v,...> - -set_tgrp_attr <tgrp> : List all attributes for a device group/target. + -set_tgrp_attr <tgrp> : Sets device group/target attribute(s) + <p> to value <v>. -dev_group <dgrp> -attributes <p=v,...> - -set_ttgt_attr <tgt> : List all attributes for a target group target. + -set_ttgt_attr <tgt> : Set target group target attribute(s) + <p> to value <v>. -dev_group <dgrp> -tgt_group <tgrp> -attributes <p=v,...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2015-11-11 23:56:58
|
Revision: 6671 http://sourceforge.net/p/scst/svn/6671 Author: bvassche Date: 2015-11-11 23:56:56 +0000 (Wed, 11 Nov 2015) Log Message: ----------- scstadmin: Do not save copy_manager LUN definitions Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-11-11 22:05:05 UTC (rev 6670) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-11-11 23:56:56 UTC (rev 6671) @@ -1423,6 +1423,8 @@ } foreach my $driver (sort keys %{$CURRENT{'assign'}}) { + next if $driver eq 'copy_manager'; + my $driver_buff; my ($drv_attrs, $errorString) = $SCST->driverAttributes($driver); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2015-11-13 19:07:13
|
Revision: 6689 http://sourceforge.net/p/scst/svn/6689 Author: bvassche Date: 2015-11-13 19:07:10 +0000 (Fri, 13 Nov 2015) Log Message: ----------- scstadmin: Do not try to clear copy manager assignments This patch avoids that the following error message is displayed on the console while "/etc/init.d/scst start" is executed: scst: scst_cm_mgmt:3556:***ERROR***: Device copy_manager_tgt not found Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-11-13 16:26:09 UTC (rev 6688) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-11-13 19:07:10 UTC (rev 6689) @@ -2199,6 +2199,8 @@ $assignments = $$config{'TARGET_DRIVER'}; foreach my $driver (sort keys %{$assignments}) { + next if $driver eq 'copy_manager'; + if (!defined($CURRENT{'assign'}->{$driver})) { condExit("Target driver '$driver' is not loaded or available."); } @@ -2697,6 +2699,8 @@ } foreach my $driver (sort keys %{$assignments}) { + next if $driver eq 'copy_manager'; + foreach my $target (sort keys %{$$assignments{$driver}}) { foreach my $group (sort keys %{$$assignments{$driver}->{$target}->{'GROUP'}}) { clearInitiators($driver, $target, $group); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2015-12-02 22:59:35
|
Revision: 6717 http://sourceforge.net/p/scst/svn/6717 Author: bvassche Date: 2015-12-02 22:59:33 +0000 (Wed, 02 Dec 2015) Log Message: ----------- scstadmin: Ensure that -no_lip takes effect for all SCST configuration commands Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-12-02 16:57:45 UTC (rev 6716) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-12-02 22:59:33 UTC (rev 6717) @@ -1051,7 +1051,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = removeVirtualTarget($driver, $removeTarget); - $rc = issueLip($driver) if (!$rc); + $rc = issueLip($driver) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; @@ -1071,7 +1071,7 @@ defined($addInitiator) && do { print "\n-> Making requested changes.\n"; $rc = addInitiator($driver, $target, $group, $addInitiator); - $rc = issueLip($driver, $target) if (!$rc); + $rc = issueLip($driver, $target) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; @@ -1079,7 +1079,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = removeInitiator($driver, $target, $group, $removeInitiator); - $rc = issueLip($driver, $target) if (!$rc); + $rc = issueLip($driver, $target) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; @@ -1087,7 +1087,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = moveInitiator($driver, $target, $group, $moveInitiator, $to); - $rc = issueLip($driver, $target) if (!$rc); + $rc = issueLip($driver, $target) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; @@ -1095,14 +1095,14 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = clearInitiators($driver, $target, $group); - $rc = issueLip($driver, $target) if (!$rc); + $rc = issueLip($driver, $target) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; defined($addLun) && do { print "\n-> Making requested changes.\n"; $rc = addLun($driver, $target, $device, $addLun, $attributes, $group); - $rc = issueLip($driver, $target) if (!$rc); + $rc = issueLip($driver, $target) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; @@ -1110,7 +1110,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = removeLun($driver, $target, $removeLun, $group); - $rc = issueLip($driver, $target) if (!$rc); + $rc = issueLip($driver, $target) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; @@ -1118,7 +1118,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = replaceLun($driver, $target, $group, $replaceLun, $device, $attributes); - $rc = issueLip($driver, $target) if (!$rc); + $rc = issueLip($driver, $target) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; @@ -1126,7 +1126,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = clearLuns($driver, $target, $group); - $rc = issueLip($driver, $target) if (!$rc); + $rc = issueLip($driver, $target) if (!$rc && !$noLip); print "\t-> Done.\n"; last SWITCH; }; @@ -1145,7 +1145,7 @@ }; defined($issueLip) && do { print "\n-> Making requested changes.\n"; - $rc = issueLip($driver, $issueLip, TRUE); + $rc = issueLip($driver, $issueLip, TRUE) if (!$noLip); print "\t-> Done.\n"; last SWITCH; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2015-12-11 18:35:36
|
Revision: 6735 http://sourceforge.net/p/scst/svn/6735 Author: bvassche Date: 2015-12-11 18:35:34 +0000 (Fri, 11 Dec 2015) Log Message: ----------- scstadmin, FC: By default, do not issue LIP. Add option -lip. Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-12-11 18:34:39 UTC (rev 6734) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2015-12-11 18:35:34 UTC (rev 6735) @@ -204,8 +204,10 @@ -issue_lip [<t>] [-driver <driver>] : Issue a LIP for a specific driver/target or for all drivers and targets. - -no_lip : Don\'t automatically issue a LIP after applying + -lip : Issue a LIP after having applied FC configuration changes. + -no_lip : Don\'t automatically issue a LIP after having + applied FC configuration changes. Options -nonkey : When writing a config file or listing attributes, @@ -349,6 +351,7 @@ my $enableTarget; my $disableTarget; my $issueLip; + my $lip; my $noLip; my $handler; @@ -444,6 +447,7 @@ 'enable_target=s' => \$enableTarget, 'disable_target=s' => \$disableTarget, 'issue_lip:s' => \$issueLip, + 'lip' => \$lip, 'no_lip' => \$noLip, 'handler=s' => \$handler, @@ -478,9 +482,10 @@ $_NOPROMPT_ = TRUE if (defined($_NOPROMPT_)); $_CONT_ON_ERR_ = TRUE if (defined($_CONT_ON_ERR_)); - $force = TRUE if (defined($force)); + $force = TRUE if (defined($force)); $nonkey = TRUE if (defined($nonkey)); - $noLip = TRUE if (defined($noLip)); + $lip = TRUE if (defined($lip)); + $noLip = TRUE if (defined($noLip)); my $query_mode = defined($listHandler) || defined($listDevice) || defined($listDeviceGroup) || defined($listTargetGroup) || defined($listDriver) || defined($listTarget) || defined($listGroup) || defined($listSessions) || @@ -707,25 +712,104 @@ } } - return ($applyConfig, $clearConfig, $writeConfig, $checkConfig, - $listScstAttr, $listHandler, $listDevice, $listDeviceGroup, $listTargetGroup, $listDriver, $listTarget, $listGroup, - $listSessions, $listHandlerAttr, $listDeviceAttr, $listDriverAttr, $listTargetAttr, - $listDeviceGroupAttr, $listTargetGroupAttr, $listTargetGroupTargetAttr, - $listGroupAttr, $listLunAttr, $listInitiatorAttr, $setScstAttr, $setHandlerAttr, - $setDeviceAttr, $setDriverAttr, $setTargetAttr, $setGroupAttr, $setLunAttr, $setInitiatorAttr, - $setDeviceGroupAttr, $setTargetGroupAttr, $setTargetGroupTargetAttr, - $addDriverAttr, $addTargetAttr, $remDriverAttr, $remTargetAttr, - $openDev, $closeDev, $resyncDev, - $addDevGroup, $removeDevGroup, $addDevGroupDevice, $removeDevGroupDevice, - $addTargetGroup, $removeTargetGroup, $addTargetGroupTarget, $removeTargetGroupTarget, - $addTarget, $removeTarget, - $addGroup, $removeGroup, - $addInitiator, $removeInitiator, $moveInitiator, $clearInitiators, - $addLun, $removeLun, $replaceLun, $clearLuns, - $enableTarget, $disableTarget, $issueLip, $noLip, - $handler, \%_attributes, - $driver, $target, $group, $to, $device,, $deviceGroup, $targetGroup, - $nonkey, $force); + my %args = ( + applyConfig => $applyConfig, + clearConfig => $clearConfig, + writeConfig => $writeConfig, + checkConfig => $checkConfig, + + listScstAttr => $listScstAttr, + listHandler => $listHandler, + listDevice => $listDevice, + listDeviceGroup => $listDeviceGroup, + listTargetGroup => $listTargetGroup, + listDriver => $listDriver, + listTarget => $listTarget, + listGroup => $listGroup, + + listSessions => $listSessions, + listHandlerAttr => $listHandlerAttr, + listDeviceAttr => $listDeviceAttr, + listDriverAttr => $listDriverAttr, + listTargetAttr => $listTargetAttr, + + listDeviceGroupAttr => $listDeviceGroupAttr, + listTargetGroupAttr => $listTargetGroupAttr, + listTargetGroupTargetAttr => $listTargetGroupTargetAttr, + + listGroupAttr => $listGroupAttr, + listLunAttr => $listLunAttr, + listInitiatorAttr => $listInitiatorAttr, + setScstAttr => $setScstAttr, + setHandlerAttr => $setHandlerAttr, + + setDeviceAttr => $setDeviceAttr, + setDriverAttr => $setDriverAttr, + setTargetAttr => $setTargetAttr, + setGroupAttr => $setGroupAttr, + setLunAttr => $setLunAttr, + setInitiatorAttr => $setInitiatorAttr, + + setDeviceGroupAttr => $setDeviceGroupAttr, + setTargetGroupAttr => $setTargetGroupAttr, + setTargetGroupTargetAttr => $setTargetGroupTargetAttr, + + addDriverAttr => $addDriverAttr, + addTargetAttr => $addTargetAttr, + remDriverAttr => $remDriverAttr, + remTargetAttr => $remTargetAttr, + + openDev => $openDev, + closeDev => $closeDev, + resyncDev => $resyncDev, + + addDevGroup => $addDevGroup, + removeDevGroup => $removeDevGroup, + addDevGroupDevice => $addDevGroupDevice, + removeDevGroupDevice => $removeDevGroupDevice, + + addTargetGroup => $addTargetGroup, + removeTargetGroup => $removeTargetGroup, + addTargetGroupTarget => $addTargetGroupTarget, + removeTargetGroupTarget => $removeTargetGroupTarget, + + addTarget => $addTarget, + removeTarget => $removeTarget, + + addGroup => $addGroup, + removeGroup => $removeGroup, + + addInitiator => $addInitiator, + removeInitiator => $removeInitiator, + moveInitiator => $moveInitiator, + clearInitiators => $clearInitiators, + + addLun => $addLun, + removeLun => $removeLun, + replaceLun => $replaceLun, + clearLuns => $clearLuns, + + enableTarget => $enableTarget, + disableTarget => $disableTarget, + issueLip => $issueLip, + lip => $lip, + noLip => $noLip, + + handler => $handler, + attributes => \%_attributes, + + driver => $driver, + target => $target, + group => $group, + to => $to, + device => $device, + deviceGroup => $deviceGroup, + targetGroup => $targetGroup, + + nonkey => $nonkey, + force => $force, + ); + return \%args; } sub main { @@ -736,26 +820,104 @@ # We need to run as root if ( $> ) {die("This program must run as root.\n");} - my ($applyConfig, $clearConfig, $writeConfig, $checkConfig, - $listScstAttr, $listHandler, $listDevice, $listDeviceGroup, $listTargetGroup, $listDriver, $listTarget, $listGroup, - $listSessions, $listHandlerAttr, $listDeviceAttr, $listDriverAttr, $listTargetAttr, - $listDeviceGroupAttr, $listTargetGroupAttr, $listTargetGroupTargetAttr, - $listGroupAttr, $listLunAttr, $listInitiatorAttr, $setScstAttr, $setHandlerAttr, - $setDeviceAttr, $setDriverAttr, $setTargetAttr, $setGroupAttr, $setLunAttr, $setInitiatorAttr, - $setDeviceGroupAttr, $setTargetGroupAttr, $setTargetGroupTargetAttr, - $addDriverAttr, $addTargetAttr, $remDriverAttr, $remTargetAttr, - $openDev, $closeDev, $resyncDev, - $addDevGroup, $removeDevGroup, $addDevGroupDevice, $removeDevGroupDevice, - $addTargetGroup, $removeTargetGroup, $addTargetGroupTarget, $removeTargetGroupTarget, - $addTarget, $removeTarget, - $addGroup, $removeGroup, - $addInitiator, $removeInitiator, $moveInitiator, $clearInitiators, - $addLun, $removeLun, $replaceLun, $clearLuns, - $enableTarget, $disableTarget, $issueLip, $noLip, - $handler, $attributes, - $driver, $target, $group, $to, $device, $deviceGroup, $targetGroup, - $nonkey, $force) = getArgs(); + my $args = getArgs(); + my $applyConfig = $args->{applyConfig}; + my $clearConfig = $args->{clearConfig}; + my $writeConfig = $args->{writeConfig}; + my $checkConfig = $args->{checkConfig}; + + my $listScstAttr = $args->{listScstAttr}; + my $listHandler = $args->{listHandler}; + my $listDevice = $args->{listDevice}; + my $listDeviceGroup = $args->{listDeviceGroup}; + my $listTargetGroup = $args->{listTargetGroup}; + my $listDriver = $args->{listDriver}; + my $listTarget = $args->{listTarget}; + my $listGroup = $args->{listGroup}; + + my $listSessions = $args->{listSessions}; + my $listHandlerAttr = $args->{listHandlerAttr}; + my $listDeviceAttr = $args->{listDeviceAttr}; + my $listDriverAttr = $args->{listDriverAttr}; + my $listTargetAttr = $args->{listTargetAttr}; + + my $listDeviceGroupAttr = $args->{listDeviceGroupAttr}; + my $listTargetGroupAttr = $args->{listTargetGroupAttr}; + my $listTargetGroupTargetAttr = $args->{listTargetGroupTargetAttr}; + + my $listGroupAttr = $args->{listGroupAttr}; + my $listLunAttr = $args->{listLunAttr}; + my $listInitiatorAttr = $args->{listInitiatorAttr}; + my $setScstAttr = $args->{setScstAttr}; + my $setHandlerAttr = $args->{setHandlerAttr}; + + my $setDeviceAttr = $args->{setDeviceAttr}; + my $setDriverAttr = $args->{setDriverAttr}; + my $setTargetAttr = $args->{setTargetAttr}; + my $setGroupAttr = $args->{setGroupAttr}; + my $setLunAttr = $args->{setLunAttr}; + my $setInitiatorAttr = $args->{setInitiatorAttr}; + + my $setDeviceGroupAttr = $args->{setDeviceGroupAttr}; + my $setTargetGroupAttr = $args->{setTargetGroupAttr}; + my $setTargetGroupTargetAttr = $args->{setTargetGroupTargetAttr}; + + my $addDriverAttr = $args->{addDriverAttr}; + my $addTargetAttr = $args->{addTargetAttr}; + my $remDriverAttr = $args->{remDriverAttr}; + my $remTargetAttr = $args->{remTargetAttr}; + + my $openDev = $args->{openDev}; + my $closeDev = $args->{closeDev}; + my $resyncDev = $args->{resyncDev}; + + my $addDevGroup = $args->{addDevGroup}; + my $removeDevGroup = $args->{removeDevGroup}; + my $addDevGroupDevice = $args->{addDevGroupDevice}; + my $removeDevGroupDevice = $args->{removeDevGroupDevice}; + + my $addTargetGroup = $args->{addTargetGroup}; + my $removeTargetGroup = $args->{removeTargetGroup}; + my $addTargetGroupTarget = $args->{addTargetGroupTarget}; + my $removeTargetGroupTarget = $args->{removeTargetGroupTarget}; + + my $addTarget = $args->{addTarget}; + my $removeTarget = $args->{removeTarget}; + + my $addGroup = $args->{addGroup}; + my $removeGroup = $args->{removeGroup}; + + my $addInitiator = $args->{addInitiator}; + my $removeInitiator = $args->{removeInitiator}; + my $moveInitiator = $args->{moveInitiator}; + my $clearInitiators = $args->{clearInitiators}; + + my $addLun = $args->{addLun}; + my $removeLun = $args->{removeLun}; + my $replaceLun = $args->{replaceLun}; + my $clearLuns = $args->{clearLuns}; + + my $enableTarget = $args->{enableTarget}; + my $disableTarget = $args->{disableTarget}; + my $issueLip = $args->{issueLip}; + my $lip = $args->{lip}; + my $noLip = $args->{noLip}; + + my $handler = $args->{handler}; + my $attributes = $args->{attributes}; + + my $driver = $args->{driver}; + my $target = $args->{target}; + my $group = $args->{group}; + my $to = $args->{to}; + my $device = $args->{device}; + my $deviceGroup = $args->{deviceGroup}; + my $targetGroup = $args->{targetGroup}; + + my $nonkey = $args->{nonkey}; + my $force = $args->{force}; + $SCST = new SCST::SCST($_DEBUG_); my $rc = readWorkingConfig($force); @@ -770,7 +932,7 @@ condExit("Configuration has errors, aborting.") if ($rc); last if ($force && prompt()); my $changes = applyConfiguration($force); - $rc = issueLip() if ($changes && !$noLip); + $rc = issueLip() if ($changes && $lip); last SWITCH; }; defined($checkConfig) && do { @@ -786,7 +948,7 @@ defined($clearConfig) && do { last if (prompt()); $rc = clearConfiguration(); - $rc = issueLip() if (!$rc && !$noLip); + $rc = issueLip() if (!$rc && $lip); last SWITCH; }; defined($listHandler) && do { @@ -945,14 +1107,14 @@ defined($addDriverAttr) && do { print "\n-> Making requested changes.\n"; $rc = addDriverDynamicAttributes($addDriverAttr, $attributes); - $rc = issueLip() if (!$rc && !$noLip); + $rc = issueLip() if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; defined($addTargetAttr) && do { print "\n-> Making requested changes.\n"; $rc = addTargetDynamicAttributes($driver, $addTargetAttr, $attributes); - $rc = issueLip() if (!$rc && !$noLip); + $rc = issueLip() if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -960,7 +1122,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = removeDriverDynamicAttributes($remDriverAttr, $attributes); - $rc = issueLip() if (!$rc && !$noLip); + $rc = issueLip() if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -968,7 +1130,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = removeTargetDynamicAttributes($driver, $remTargetAttr, $attributes); - $rc = issueLip() if (!$rc && !$noLip); + $rc = issueLip() if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -982,14 +1144,14 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = closeDevice($handler, $closeDev, $force); - $rc = issueLip() if (!$rc && !$noLip); + $rc = issueLip() if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; defined($resyncDev) && do { print "\n-> Making requested changes.\n"; $rc = resyncDevice($resyncDev); - $rc = issueLip() if (!$rc && !$noLip); + $rc = issueLip() if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -1051,7 +1213,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = removeVirtualTarget($driver, $removeTarget); - $rc = issueLip($driver) if (!$rc && !$noLip); + $rc = issueLip($driver) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -1071,7 +1233,7 @@ defined($addInitiator) && do { print "\n-> Making requested changes.\n"; $rc = addInitiator($driver, $target, $group, $addInitiator); - $rc = issueLip($driver, $target) if (!$rc && !$noLip); + $rc = issueLip($driver, $target) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -1079,7 +1241,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = removeInitiator($driver, $target, $group, $removeInitiator); - $rc = issueLip($driver, $target) if (!$rc && !$noLip); + $rc = issueLip($driver, $target) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -1087,7 +1249,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = moveInitiator($driver, $target, $group, $moveInitiator, $to); - $rc = issueLip($driver, $target) if (!$rc && !$noLip); + $rc = issueLip($driver, $target) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -1095,14 +1257,14 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = clearInitiators($driver, $target, $group); - $rc = issueLip($driver, $target) if (!$rc && !$noLip); + $rc = issueLip($driver, $target) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; defined($addLun) && do { print "\n-> Making requested changes.\n"; $rc = addLun($driver, $target, $device, $addLun, $attributes, $group); - $rc = issueLip($driver, $target) if (!$rc && !$noLip); + $rc = issueLip($driver, $target) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -1110,7 +1272,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = removeLun($driver, $target, $removeLun, $group); - $rc = issueLip($driver, $target) if (!$rc && !$noLip); + $rc = issueLip($driver, $target) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -1118,7 +1280,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = replaceLun($driver, $target, $group, $replaceLun, $device, $attributes); - $rc = issueLip($driver, $target) if (!$rc && !$noLip); + $rc = issueLip($driver, $target) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; @@ -1126,7 +1288,7 @@ last if (prompt()); print "\n-> Making requested changes.\n"; $rc = clearLuns($driver, $target, $group); - $rc = issueLip($driver, $target) if (!$rc && !$noLip); + $rc = issueLip($driver, $target) if (!$rc && $lip); print "\t-> Done.\n"; last SWITCH; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vl...@us...> - 2016-04-20 04:53:00
|
Revision: 6867 http://sourceforge.net/p/scst/svn/6867 Author: vlnb Date: 2016-04-20 04:52:58 +0000 (Wed, 20 Apr 2016) Log Message: ----------- scstadmin: prevent saving statistical dif_checks_failed attribute >From Marc Smith <mar...@mc...> Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2016-04-20 04:34:43 UTC (rev 6866) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2016-04-20 04:52:58 UTC (rev 6867) @@ -1499,6 +1499,7 @@ || defined($attr_filter) && defined($$attr_filter{$attribute})) && !defined($$attributes{$attribute}->{'keys'}) + && $attribute ne 'dif_checks_failed' && $attribute ne 'enabled' && $attribute ne 'hw_target') { my $value = $$attributes{$attribute}->{'value'}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2016-10-04 05:24:38
|
Revision: 6988 http://sourceforge.net/p/scst/svn/6988 Author: bvassche Date: 2016-10-04 05:24:35 +0000 (Tue, 04 Oct 2016) Log Message: ----------- scstadmin: Bump version number Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2016-10-04 05:11:53 UTC (rev 6987) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2016-10-04 05:24:35 UTC (rev 6988) @@ -1,6 +1,6 @@ #!/usr/bin/perl -$Version = 'SCST Configurator v3.1.0-pre1'; +$Version = 'SCST Configurator v3.3.0-pre1'; # Configures SCST # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2016-10-21 21:54:05
|
Revision: 7014 http://sourceforge.net/p/scst/svn/7014 Author: bvassche Date: 2016-10-21 21:54:02 +0000 (Fri, 21 Oct 2016) Log Message: ----------- scstadmin: Avoid that specifying an attribute multiple times results in an incomprehensible error message Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2016-10-21 21:21:29 UTC (rev 7013) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2016-10-21 21:54:02 UTC (rev 7014) @@ -5762,6 +5762,8 @@ if (!scalar keys %{$$config{$attr}}) { $attributes{$attr} = ''; } elsif ((keys %{$$config{$attr}}) > 1) { + immediateExit("Invalid configuration encountered. ". + "Attribute '$attr' has multiple values."); foreach my $value (keys %{$$config{$attr}}) { push @{$attributes{$attr}}, $value; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2017-02-05 06:52:08
|
Revision: 7092 http://sourceforge.net/p/scst/svn/7092 Author: bvassche Date: 2017-02-05 06:52:06 +0000 (Sun, 05 Feb 2017) Log Message: ----------- scstadmin: Revert r7014 The immediateExit() call introduced in r7014 prevents to assign multiple values to attributes that support multiple values, e.g. 'allowed_portal'. Hence revert r7014. Revision Links: -------------- http://sourceforge.net/p/scst/svn/7014 http://sourceforge.net/p/scst/svn/7014 http://sourceforge.net/p/scst/svn/7014 Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2017-01-24 00:29:41 UTC (rev 7091) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2017-02-05 06:52:06 UTC (rev 7092) @@ -5762,8 +5762,6 @@ if (!scalar keys %{$$config{$attr}}) { $attributes{$attr} = ''; } elsif ((keys %{$$config{$attr}}) > 1) { - immediateExit("Invalid configuration encountered. ". - "Attribute '$attr' has multiple values."); foreach my $value (keys %{$$config{$attr}}) { push @{$attributes{$attr}}, $value; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2017-12-31 05:39:40
|
Revision: 7310 http://sourceforge.net/p/scst/svn/7310 Author: bvassche Date: 2017-12-31 05:39:38 +0000 (Sun, 31 Dec 2017) Log Message: ----------- scstadmin: Fix -close_dev Avoid that closing a device fails and an empty export list is reported if a device is currently not exported. This patch is based on a patch provided by Dzmitry Kotsikau <dko...@gm...>. Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2017-12-30 03:37:31 UTC (rev 7309) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2017-12-31 05:39:38 UTC (rev 7310) @@ -4751,7 +4751,8 @@ my ($attributes, $errorString) = $SCST->deviceAttributes($device); if (!$force) { - if (keys %{$$attributes{'exported'}}) { + if (keys %{$$attributes{'exported'}} && + $$attributes{'exported'}->{'value'}) { listExported($device, $attributes); immediateExit("Device '$device' still in use, aborting. ". "Use -force to override."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2018-01-04 02:40:16
|
Revision: 7319 http://sourceforge.net/p/scst/svn/7319 Author: bvassche Date: 2018-01-04 02:40:13 +0000 (Thu, 04 Jan 2018) Log Message: ----------- scstadmin: Revert r7310 because it was reported not to fix the issue it should have fixed Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-04 00:30:22 UTC (rev 7318) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-04 02:40:13 UTC (rev 7319) @@ -4751,8 +4751,7 @@ my ($attributes, $errorString) = $SCST->deviceAttributes($device); if (!$force) { - if (keys %{$$attributes{'exported'}} && - $$attributes{'exported'}->{'value'}) { + if (keys %{$$attributes{'exported'}}) { listExported($device, $attributes); immediateExit("Device '$device' still in use, aborting. ". "Use -force to override."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2018-01-04 04:15:13
|
Revision: 7321 http://sourceforge.net/p/scst/svn/7321 Author: bvassche Date: 2018-01-04 04:15:11 +0000 (Thu, 04 Jan 2018) Log Message: ----------- scstadmin: Add the -dumpAttrs command line option Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-04 04:14:08 UTC (rev 7320) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-04 04:15:11 UTC (rev 7321) @@ -259,6 +259,7 @@ } use SCST::SCST 1.0.0; +use Data::Dumper; use Getopt::Long; use IO::File; use IO::Dir; @@ -383,6 +384,7 @@ my $show_usage; my $nonkey; my $force; + my $dumpAttrs; my $p = new Getopt::Long::Parser; @@ -483,6 +485,7 @@ 'noprompt' => \$_NOPROMPT_, 'cont_on_err' => \$_CONT_ON_ERR_, 'force' => \$force, + 'dumpAttrs' => \$dumpAttrs, 'debug' => \$_DEBUG_)) { exit 1; @@ -823,6 +826,7 @@ nonkey => $nonkey, force => $force, + dumpAttrs => $dumpAttrs, ); return \%args; } @@ -932,6 +936,7 @@ my $nonkey = $args->{nonkey}; my $force = $args->{force}; + my $dumpAttrs = $args->{dumpAttrs}; $SCST = new SCST::SCST($_DEBUG_); @@ -1326,6 +1331,18 @@ print "\t-> Done.\n"; last SWITCH; }; + defined($dumpAttrs) && do { + print "SCST attributes:\n"; + print Dumper($SCST->scstAttributes()); + foreach my $handler (sort keys %{$CURRENT{'handler'}}) { + my $devices = $CURRENT{'handler'}->{$handler}; + foreach my $device (sort @{$devices}) { + print "Device $device attributes:\n"; + print Dumper($SCST->deviceAttributes($device)); + } + } + last SWITCH; + }; if (!$all_good) { print "No valid operations specified.\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2018-01-07 01:04:11
|
Revision: 7332 http://sourceforge.net/p/scst/svn/7332 Author: bvassche Date: 2018-01-07 01:04:08 +0000 (Sun, 07 Jan 2018) Log Message: ----------- scstadmin: Align exports columns properly An example: # scstadmin -noprompt -handler vdisk_fileio -close_dev diskf0 Collecting current configuration: done. -> Making requested changes. Device 'diskf0' is currently in use by the following: Driver Target Group Lun -------------------------------------------- iscsi iqn.2012-06.be.bva:tgt1 61 scst_local disks 1 FATAL: Received the following error: Device 'diskf0' still in use, aborting. Use -force to override. This patch is based on a proposal from Dzmitry Kotsikau. Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-07 01:02:42 UTC (rev 7331) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-07 01:04:08 UTC (rev 7332) @@ -3556,9 +3556,9 @@ if (keys %{$$attributes{'exported'}}) { my $exported = $$attributes{'exported'}->{'value'}; - my $l_driver; - my $l_target; - my $l_group; + my $l_driver = length('Driver'); + my $l_target = length('Target'); + my $l_group = length('Group'); foreach my $driver (keys %{$exported}) { $l_driver = length($driver) @@ -3579,9 +3579,7 @@ printf("\t%-*s %-*s %-*s %-4s\n", $l_driver, 'Driver', $l_target, 'Target', $l_group, 'Group', 'Lun'); print "\t"; - for (my $x = 0; $x < ($l_driver + $l_target + $l_group + 5); $x++) { - print "-"; - } + print join("", "-" x ($l_driver + $l_target + $l_group + 6)); print "\n"; foreach my $driver (sort keys %{$exported}) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2018-01-07 02:23:52
|
Revision: 7333 http://sourceforge.net/p/scst/svn/7333 Author: bvassche Date: 2018-01-07 02:23:49 +0000 (Sun, 07 Jan 2018) Log Message: ----------- scstadmin, listExported: Remove dead code Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-07 01:04:08 UTC (rev 7332) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-07 02:23:49 UTC (rev 7333) @@ -3546,56 +3546,42 @@ sub listExported { my $device = shift; my $attributes = shift; - my $errorString; + my $exported = $$attributes{'exported'}->{'value'}; + my $l_driver = length('Driver'); + my $l_target = length('Target'); + my $l_group = length('Group'); - if (!$attributes) { - ($attributes, $errorString) = $SCST->deviceAttributes($device) ; - return TRUE if issueWarning($errorString); - } + foreach my $driver (keys %{$exported}) { + $l_driver = length($driver) + if (length($driver) > $l_driver); - if (keys %{$$attributes{'exported'}}) { - my $exported = $$attributes{'exported'}->{'value'}; + foreach my $target (keys %{$$exported{$driver}}) { + $l_target = length($target) + if (length($target) > $l_target); - my $l_driver = length('Driver'); - my $l_target = length('Target'); - my $l_group = length('Group'); - - foreach my $driver (keys %{$exported}) { - $l_driver = length($driver) - if (length($driver) > $l_driver); - - foreach my $target (keys %{$$exported{$driver}}) { - $l_target = length($target) - if (length($target) > $l_target); - - foreach my $group (keys %{$$exported{$driver}->{$target}}) { - $l_group = length($group) - if (length($group) > $l_group); - } + foreach my $group (keys %{$$exported{$driver}->{$target}}) { + $l_group = length($group) + if (length($group) > $l_group); } } + } - print "Device '$device' is currently in use by the following:\n\n"; - printf("\t%-*s %-*s %-*s %-4s\n", $l_driver, 'Driver', $l_target, 'Target', - $l_group, 'Group', 'Lun'); - print "\t"; - print join("", "-" x ($l_driver + $l_target + $l_group + 6)); - print "\n"; + print "Device '$device' is currently in use by the following:\n\n"; + printf("\t%-*s %-*s %-*s %-4s\n", $l_driver, 'Driver', $l_target, 'Target', + $l_group, 'Group', 'Lun'); + print "\t"; + print join("", "-" x ($l_driver + $l_target + $l_group + 6)); + print "\n"; - foreach my $driver (sort keys %{$exported}) { - foreach my $target (sort keys %{$$exported{$driver}}) { - foreach my $group (sort keys %{$$exported{$driver}->{$target}}) { - my $lun = $$exported{$driver}->{$target}->{$group}; - printf("\t%-*s %-*s %-*s %-4s\n", $l_driver, $driver, - $l_target, $target, $l_group, $group, $lun); - } + foreach my $driver (sort keys %{$exported}) { + foreach my $target (sort keys %{$$exported{$driver}}) { + foreach my $group (sort keys %{$$exported{$driver}->{$target}}) { + my $lun = $$exported{$driver}->{$target}->{$group}; + printf("\t%-*s %-*s %-*s %-4s\n", $l_driver, $driver, + $l_target, $target, $l_group, $group, $lun); } } - } else { - print "Device '$device' is not currently in use by any group.\n"; } - - return FALSE; } sub listAttributes { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2018-01-07 02:25:13
|
Revision: 7334 http://sourceforge.net/p/scst/svn/7334 Author: bvassche Date: 2018-01-07 02:25:10 +0000 (Sun, 07 Jan 2018) Log Message: ----------- scstadmin: Slightly change the output format of exported LUNs An example: # scstadmin -noprompt -handler vdisk_fileio -close_dev diskf0 Collecting current configuration: done. -> Making requested changes. Device 'diskf0' is currently in use by the following: Driver Target Group Lun ---------- ----------------------- ----- ---- iscsi iqn.2012-06.be.bva:tgt1 61 scst_local disks 1 FATAL: Received the following error: Device 'diskf0' still in use, aborting. Use -force to override. Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-07 02:23:49 UTC (rev 7333) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-01-07 02:25:10 UTC (rev 7334) @@ -3550,6 +3550,7 @@ my $l_driver = length('Driver'); my $l_target = length('Target'); my $l_group = length('Group'); + my $fmt = "\t%-*s %-*s %-*s %-4s\n"; foreach my $driver (keys %{$exported}) { $l_driver = length($driver) @@ -3567,18 +3568,18 @@ } print "Device '$device' is currently in use by the following:\n\n"; - printf("\t%-*s %-*s %-*s %-4s\n", $l_driver, 'Driver', $l_target, 'Target', + printf($fmt, $l_driver, 'Driver', $l_target, 'Target', $l_group, 'Group', 'Lun'); - print "\t"; - print join("", "-" x ($l_driver + $l_target + $l_group + 6)); - print "\n"; + printf($fmt, $l_driver, join("", "-" x $l_driver), + $l_target, join("", "-" x $l_target), + $l_group, join("", "-" x $l_group), join("", "-" x 4)); foreach my $driver (sort keys %{$exported}) { foreach my $target (sort keys %{$$exported{$driver}}) { foreach my $group (sort keys %{$$exported{$driver}->{$target}}) { my $lun = $$exported{$driver}->{$target}->{$group}; - printf("\t%-*s %-*s %-*s %-4s\n", $l_driver, $driver, - $l_target, $target, $l_group, $group, $lun); + printf($fmt, $l_driver, $driver, $l_target, + $target, $l_group, $group, $lun); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2018-03-04 19:34:58
|
Revision: 7375 http://sourceforge.net/p/scst/svn/7375 Author: bvassche Date: 2018-03-04 19:34:55 +0000 (Sun, 04 Mar 2018) Log Message: ----------- scstadmin: Remove 'use Test' Since scstadmin doesn't use the Perl module 'Test', remove 'use Test'. See also trunk r6736. Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-03-04 19:34:18 UTC (rev 7374) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2018-03-04 19:34:55 UTC (rev 7375) @@ -246,7 +246,6 @@ use Cwd qw(abs_path); use File::Basename; use File::Spec; -use Test; BEGIN { my $site_lib = '%INSTALLSITELIB%'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bva...@us...> - 2019-02-16 19:03:45
|
Revision: 7938 http://sourceforge.net/p/scst/svn/7938 Author: bvassche Date: 2019-02-16 19:03:39 +0000 (Sat, 16 Feb 2019) Log Message: ----------- scstadmin: Avoid shadowing the errorString declaration, part 3 Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2019-02-16 18:59:50 UTC (rev 7937) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2019-02-16 19:03:39 UTC (rev 7938) @@ -1380,7 +1380,8 @@ # Get current assignments - my ($drivers, $errorString) = $SCST->drivers(); + my $drivers; + ($drivers, $errorString) = $SCST->drivers(); immediateExit($errorString); foreach my $driver (@{$drivers}) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |