]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/GlusterfsPlugin.pm
list volumes: also return backup type for backups
[pve-storage.git] / PVE / Storage / GlusterfsPlugin.pm
index 599bca29cd6551e6ded23607d58084355b414c42..d8d2b88f613b612a4da221dcfb283f2a91f3a7a3 100644 (file)
@@ -137,6 +137,7 @@ sub options {
        format => { optional => 1 },
        mkdir => { optional => 1 },
        bwlimit => { optional => 1 },
+       preallocation => { optional => 1 },
     };
 }
 
@@ -197,7 +198,7 @@ sub path {
 sub clone_image {
     my ($class, $scfg, $storeid, $volname, $vmid, $snap) = @_;
 
-    die "storage definintion has no path\n" if !$scfg->{path};
+    die "storage definition has no path\n" if !$scfg->{path};
 
     my ($vtype, $basename, $basevmid, undef, undef, $isBase, $format) =
        $class->parse_volname($volname);
@@ -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";