Show full device name

This commit is contained in:
Jamie Cameron
2012-10-17 21:53:57 -07:00
parent 211ef97af3
commit 2013e058ed
3 changed files with 19 additions and 0 deletions

View File

@@ -153,6 +153,12 @@ foreach my $l (@lines) {
elsif ($l =~ /iSCSI\s+Session\s+State:\s+(\S+)/) {
$conn->{'session'} = $1;
}
elsif ($l =~ /scsi(\d+)\s+Channel\s+(\d+)\s+Id\s+(\d+)\s+Lun:\s+(\d+)/) {
$conn->{'scsihost'} = $1;
$conn->{'scsichannel'} = $2;
$conn->{'scsiid'} = $3;
$conn->{'scsilun'} = $4;
}
elsif ($l =~ /Attached\s+scsi\s+disk\s+(\S+)/) {
$conn->{'device'} = "/dev/$1";
}
@@ -161,6 +167,13 @@ foreach my $l (@lines) {
$conn->{$1} = $2;
}
}
foreach my $c (@rv) {
my $dev = "/dev/disk/by-path/ip-$c->{'ip'}:$c->{'port'}-".
"iscsi-$c->{'name'}:$c->{'target'}-lun-$c->{'scsilun'}";
if (-e $dev) {
$conn->{'longdevice'} = $dev;
}
}
return \@rv;
}

View File

@@ -164,6 +164,7 @@ vconn_password_in=Client password
vconn_none=None required
vconn_device=Local device file
vconn_device2=Local device name
vconn_device3=Constant device name
vconn_delete=Disconnect Connection
vconn_users=Current users
vconn_size=Disk size

View File

@@ -52,6 +52,11 @@ if ($conn->{'device'}) {
print &ui_table_row($text{'vconn_device2'},
&mount::device_name($conn->{'device'}));
if ($conn->{'longdevice'}) {
print &ui_table_row($text{'vconn_device3'},
"<tt>$conn->{'longdevice'}</tt>");
}
my @disks = &fdisk::list_disks_partitions();
my ($disk) = grep { $_->{'device'} eq $conn->{'device'} } @disks;
if ($disk) {