of deleting from one and adding to another the same user.
- Replace a device on a given LUN when applying the configuration instead of removing
the old device and assigning the new one.
+- If target-oriented access control mode is used, Default_ groups will first be created
+ as temporary groups and later renamed.
- Add the ability to specify options (ie: READ_ONLY) in assignments in scst.conf.
- Remove unused references to handler IOs that don't exist and cleanup the write
configuration function to only write vdisk and vcdrom devices. All other devices
my $_SCSI_ISP_ = '/proc/scsi/isp';
my $_SCSITGT_QLAISP_ = '/proc/scsi_tgt/qla_isp';
+my $_TGT_DEF_PREFIX_ = 'Default_';
+my $_TGT_TMP_PREFIX_ = 'TMP_GRP';
+
my $SCST;
my $DEVICES;
my $TARGETS;
my %seen_users;
+ my %rename_group;
+
# Cache device/handler configuration
foreach my $entry (keys %{$$config{'HANDLER'}}) {
foreach my $device (@{$$config{'HANDLER'}->{$entry}->{'DEVICE'}}) {
# Create new groups and add users..
foreach my $group (keys %used_users) {
if (!defined($USERS{$group})) {
+ if ($group =~ /^$_TGT_DEF_PREFIX_/) {
+ my $rnd_id = randomGroupId();
+ my $tmp_group = $_TGT_TMP_PREFIX_.$rnd_id;
+
+ print "\t-> Using temporary group '$tmp_group' for group '$group'.\n";
+
+ $rename_group{$tmp_group} = $group;
+ $used_users{$tmp_group} = $used_users{$group};
+ $group = $tmp_group;
+ }
+
if ($check) {
print "\t-> New group definition '$group.'\n";
$GROUPS{$group}++;
}
}
+ foreach my $tmp_group (keys %rename_group) {
+ my $group = $rename_group{$tmp_group};
+ print "\t-> Processing temporary group '$tmp_group'.\n";
+
+ renameGroup($tmp_group, $group);
+ }
+
# Enable/Disable configured targets
foreach my $type (keys %{$$config{'TARGETS'}}) {
my $enable;
return $buffer;
}
+sub randomGroupId {
+ return int(rand(10000));
+}
+
# If we have an unread error from SCST, exit immediately
sub immediateExit {
my $error = shift;