Fix: #2124 storage: add zstd support

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
This commit is contained in:
Alwin Antreich
2020-04-28 15:58:23 +02:00
committed by Fabian Grünbichler
parent 277cafc0ff
commit 014d36dbbb
6 changed files with 44 additions and 6 deletions

View File

@ -1366,10 +1366,12 @@ sub decompressor_info {
tar => {
gz => ['tar', '-z'],
lzo => ['tar', '--lzop'],
zst => ['tar', '--zstd'],
},
vma => {
gz => ['zcat'],
lzo => ['lzop', '-d', '-c'],
zst => ['zstd', '-q', '-d', '-c'],
},
};
@ -1460,7 +1462,7 @@ sub extract_vzdump_config_vma {
my $errstring;
my $err = sub {
my $output = shift;
if ($output =~ m/lzop: Broken pipe: <stdout>/ || $output =~ m/gzip: stdout: Broken pipe/) {
if ($output =~ m/lzop: Broken pipe: <stdout>/ || $output =~ m/gzip: stdout: Broken pipe/ || $output =~ m/zstd: error 70 : Write error : Broken pipe/) {
$broken_pipe = 1;
} elsif (!defined ($errstring) && $output !~ m/^\s*$/) {
$errstring = "Failed to extract config from VMA archive: $output\n";

View File

@ -18,7 +18,7 @@ use JSON;
use base qw(PVE::SectionConfig);
use constant COMPRESSOR_RE => 'gz|lzo';
use constant COMPRESSOR_RE => 'gz|lzo|zst';
our @COMMON_TAR_FLAGS = qw(
--one-file-system