my $stabledir = "/dev/disk/by-id";
if (my $dh = IO::Dir->new($stabledir)) {
- while (defined(my $tmp = $dh->read)) {
+ foreach my $tmp (sort $dh->read) {
# exclude filenames with part in name (same disk but partitions)
# use only filenames with scsi(with multipath i have the same device
# with dm-uuid-mpath , dm-name and scsi in name)
- if($tmp !~ m/-part\d+$/ && $tmp =~ m/^scsi-/) {
+ if($tmp !~ m/-part\d+$/ && ($tmp =~ m/^scsi-/ || $tmp =~ m/^dm-uuid-mpath-/)) {
my $path = "$stabledir/$tmp";
my $bdevdest = readlink($path);
if ($bdevdest && $bdevdest =~ m|^../../([^/]+)|) {
die "can't free space in iscsi storage\n";
}
+# list all luns regardless of set content_types, since we need it for
+# listing in the gui and we can only have images anyway
+sub list_volumes {
+ my ($class, $storeid, $scfg, $vmid, $content_types) = @_;
+
+ my $res = $class->list_images($storeid, $scfg, $vmid);
+
+ for my $item (@$res) {
+ $item->{content} = 'images'; # we only have images
+ }
+
+ return $res;
+}
+
sub list_images {
my ($class, $storeid, $scfg, $vmid, $vollist, $cache) = @_;