From e3770250bb2553be71bf29251d9edb5d6493e22d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 7 Jan 2018 01:02:42 +0000 Subject: [PATCH 1/2] scstadmin: Synchronize test 07 with trunk r7327 Trunk r7327 restored the 'dummy' attribute for the vdisk_nullio handler and hence changed the outcome of test 07. Update the expected output. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7331 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-result.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-result.conf b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-result.conf index b650ac13b..8bee55a95 100644 --- a/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-result.conf +++ b/scstadmin/scstadmin.sysfs/scst-1.0.0/t/07-result.conf @@ -14,7 +14,9 @@ HANDLER vdisk_fileio { } HANDLER vdisk_nullio { - DEVICE nodev + DEVICE nodev { + dummy 1 + } } TARGET_DRIVER scst_local { From 843e1e755ddd4bc394cb696ea55e8cf8ca59f824 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 7 Jan 2018 01:04:08 +0000 Subject: [PATCH 2/2] 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. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7332 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/scstadmin.sysfs/scstadmin | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scstadmin/scstadmin.sysfs/scstadmin b/scstadmin/scstadmin.sysfs/scstadmin index 540d371e3..470c14084 100755 --- a/scstadmin/scstadmin.sysfs/scstadmin +++ b/scstadmin/scstadmin.sysfs/scstadmin @@ -3556,9 +3556,9 @@ sub listExported { 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 @@ sub listExported { 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}) {