lio: list_lun: return early if volname cannot be parsed
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -207,6 +207,8 @@ my $list_view = sub {
|
|||||||
my $object = $params[0];
|
my $object = $params[0];
|
||||||
my $volname = $extract_volname->($scfg, $object);
|
my $volname = $extract_volname->($scfg, $object);
|
||||||
|
|
||||||
|
return undef if !defined($volname); # nothing to search for..
|
||||||
|
|
||||||
foreach my $lun (@{$SETTINGS->{target}->{luns}}) {
|
foreach my $lun (@{$SETTINGS->{target}->{luns}}) {
|
||||||
if ($lun->{storage_object} eq "$BACKSTORE/$volname") {
|
if ($lun->{storage_object} eq "$BACKSTORE/$volname") {
|
||||||
return $lun->{index};
|
return $lun->{index};
|
||||||
|
|||||||
Reference in New Issue
Block a user