]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/GlusterfsPlugin.pm
fix #1816: rbd: add support for erasure coded ec pools
[pve-storage.git] / PVE / Storage / GlusterfsPlugin.pm
index ea4df82a9682f949c74ac4445632d8256c9d60b1..d8d2b88f613b612a4da221dcfb283f2a91f3a7a3 100644 (file)
@@ -137,6 +137,7 @@ sub options {
        format => { optional => 1 },
        mkdir => { optional => 1 },
        bwlimit => { optional => 1 },
+       preallocation => { optional => 1 },
     };
 }
 
@@ -260,7 +261,8 @@ sub alloc_image {
 
     my $cmd = ['/usr/bin/qemu-img', 'create'];
 
-    push @$cmd, '-o', 'preallocation=metadata' if $fmt eq 'qcow2';
+    my $prealloc_opt = PVE::Storage::Plugin::preallocation_cmd_option($scfg, $fmt);
+    push @$cmd, '-o', $prealloc_opt if defined($prealloc_opt);
 
     push @$cmd, '-f', $fmt, $volumepath, "${size}K";