]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage.pm
rbd: add support to krbd
[pve-storage.git] / PVE / Storage.pm
index 0452a2de130169e83939e695d104d157f5a6cf7e..7b3dc701eccbada26fc93d6dc0b66e4ceec15847 100755 (executable)
@@ -587,7 +587,11 @@ sub vdisk_alloc {
 
     # lock shared storage
     return $plugin->cluster_lock_storage($storeid, $scfg->{shared}, undef, sub {
-       my $volname = $plugin->alloc_image($storeid, $scfg, $vmid, $fmt, $name, $size);
+       my $old_umask = umask(umask|0037);
+       my $volname = eval { $plugin->alloc_image($storeid, $scfg, $vmid, $fmt, $name, $size) };
+       my $err = $@;
+       umask $old_umask;
+       die $err if $err;
        return "$storeid:$volname";
     });
 }
@@ -878,14 +882,23 @@ sub storage_info {
     my $ids = $cfg->{ids};
 
     my $info = {};
-
+    
+    my @ctypes = PVE::Tools::split_list($content);
+    
     my $slist = [];
     foreach my $storeid (keys %$ids) {
 
-       next if $content && !$ids->{$storeid}->{content}->{$content};
-
        next if !storage_check_enabled($cfg, $storeid, undef, 1);
 
+       my $want_ctype = 0;
+       foreach my $ctype (@ctypes) {
+           if ($ids->{$storeid}->{content}->{$ctype}) {
+               $want_ctype = 1;
+               last;
+           }
+       }
+       next if !$want_ctype;
+
        my $type = $ids->{$storeid}->{type};
 
        $info->{$storeid} = {