]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/LVMPlugin.pm
Fix #2050: only provide 'conv=sparse' for LvmThin
[pve-storage.git] / PVE / Storage / LVMPlugin.pm
index 72d74646349a3b1808fd4966e609081fd191bdd8..9ad79795d6cf9d941636cb36656fbe8e8fc4368f 100644 (file)
@@ -620,8 +620,8 @@ sub volume_import {
        }
        my $file = $class->path($scfg, $volname, $storeid)
            or die "internal error: failed to get path to newly allocated volume $volname\n";
-       run_command(['dd', "of=$file", 'conv=sparse', 'bs=64k'],
-                   input => '<&'.fileno($fh));
+
+       $class->volume_import_write($fh, $file);
     };
     if (my $err = $@) {
        eval { $class->free_image($storeid, $scfg, $volname, 0) };
@@ -630,4 +630,10 @@ sub volume_import {
     }
 }
 
+sub volume_import_write {
+    my ($class, $input_fh, $output_file) = @_;
+    run_command(['dd', "of=$output_file", 'bs=64k'],
+       input => '<&'.fileno($input_fh));
+}
+
 1;