[pve-devel] [PATCH] nexenta: fix lun number parsing in sub path

Alexandre Derumier aderumier at odiso.com
Tue Aug 21 14:43:44 CEST 2012


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage/NexentaPlugin.pm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm
index 9352c74..b1a3516 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -198,7 +198,8 @@ sub path {
     my $map = nexenta_list_lun_mapping_entries($name,$scfg);
     die "could not find lun number" if !$map;
     my $lun = @$map[0]->{lun};
-
+    $lun =~ m/^(\d+)$/ or die "lun is not OK\n";
+    $lun = $1;    
     my $path = "iscsi://$portal/$target/$lun";
 
     return ($path, $vmid, $vtype);
-- 
1.7.2.5




More information about the pve-devel mailing list