change check for write-zeros

instead of hardcoding the storagetypes for writing zeros on a
backup restore, we use volume_has_feature with 'sparseinit'
for determining if we can omit writing zeros

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-02-23 12:43:51 +01:00 committed by Dietmar Maurer
parent 5abfaf2dcd
commit 88240a83fb

View File

@ -5607,9 +5607,7 @@ sub restore_vma_archive {
PVE::Storage::activate_volumes($cfg,[$volid]);
my $write_zeros = 1;
# fixme: what other storages types initialize volumes with zero?
if ($scfg->{type} eq 'dir' || $scfg->{type} eq 'nfs' || $scfg->{type} eq 'glusterfs' ||
$scfg->{type} eq 'sheepdog' || $scfg->{type} eq 'rbd') {
if (PVE::Storage::volume_has_feature($cfg, 'sparseinit', $volid)) {
$write_zeros = 0;
}