]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/ZFSPlugin.pm
prune {validate, mark}: preserve input parameter
[pve-storage.git] / PVE / Storage / ZFSPlugin.pm
index 8c6709c9112faf2b8e4f7415ed365d7e0113eda5..5b84d85f2efca5f1d96fe003d47c21bd415857eb 100644 (file)
@@ -159,7 +159,11 @@ sub zfs_get_lun_number {
 
     die "could not find lun_number for guid $guid" if !$guid;
 
-    return $class->zfs_request($scfg, undef, 'list_view', $guid);
+    if ($class->zfs_request($scfg, undef, 'list_view', $guid) =~ /^(\d+)$/) {
+       return $1;
+    }
+
+    die "lun_number for guid $guid is not a number";
 }
 
 # Configuration
@@ -289,12 +293,12 @@ sub alloc_image {
     
     die "unsupported format '$fmt'" if $fmt ne 'raw';
 
-    die "illegal name '$name' - sould be 'vm-$vmid-*'\n"
+    die "illegal name '$name' - should be 'vm-$vmid-*'\n"
     if $name && $name !~ m/^vm-$vmid-/;
 
     my $volname = $name;
 
-    $volname = $class->zfs_find_free_diskname($storeid, $scfg, $vmid, $fmt) if !$volname;
+    $volname = $class->find_free_diskname($storeid, $scfg, $vmid, $fmt) if !$volname;
     
     $class->zfs_create_zvol($scfg, $volname, $size);