mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
lsluns: print a message if no adapter or port exists
lsluns lists nothing and returns with return code 0 if no adapter (FCP device) or target port exists in sysfs. This can be confusing for the user. Print a message if no adapter exists. Print a message if no port exists on any adapter. Reported-by: Thorsten Diehl <thorsten.diehl@de.ibm.com> Suggested-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Jens Remus <jremus@linux.ibm.com> Reviewed-by: Steffen Maier <maier@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -7,6 +7,7 @@ Release history for s390-tools (MIT version)
|
|||||||
Changes of existing tools:
|
Changes of existing tools:
|
||||||
|
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
|
- lsluns: Print a message if no adapter or port exists
|
||||||
|
|
||||||
* __v2.4.0 (2018-05-07)__
|
* __v2.4.0 (2018-05-07)__
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -235,8 +235,15 @@ sub get_env_list
|
|||||||
my @res ;
|
my @res ;
|
||||||
my %res_hash;
|
my %res_hash;
|
||||||
|
|
||||||
|
if (!</sys/bus/ccw/drivers/zfcp/*.*.*/>) {
|
||||||
|
print "$PROGRAM_NAME: No adapter exists\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
@res = </sys/bus/ccw/drivers/zfcp/*.*.*/0x*>;
|
@res = </sys/bus/ccw/drivers/zfcp/*.*.*/0x*>;
|
||||||
return () if (!@res);
|
if (!@res) {
|
||||||
|
print "$PROGRAM_NAME: No port on any adapter exists\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
foreach my $entry (@res) {
|
foreach my $entry (@res) {
|
||||||
my $a = ${[split('/', $entry)]}[-2];
|
my $a = ${[split('/', $entry)]}[-2];
|
||||||
my $p = ${[split('/', $entry)]}[-1];
|
my $p = ${[split('/', $entry)]}[-1];
|
||||||
|
|||||||
Reference in New Issue
Block a user