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
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);
return undef;
}
-sub volume_snapshot_list {
- my ($class, $scfg, $storeid, $volname) = @_;
- # return an empty array if dataset does not exist.
- die "Volume_snapshot_list is not implemented for ZFS over iSCSI.\n";
-}
-
sub activate_storage {
my ($class, $storeid, $scfg, $cache) = @_;