[pve-devel] [PATCH qemu-server] Fix #2124: restore: add zstd de-compression

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jun 17 09:15:31 CEST 2019


On 6/14/19 3:37 PM, Alwin Antreich wrote:
> Recognize the .zst file extention for the zstd de-compression
> 

this patch seems reasonable, not yet tested though

> Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
> ---
>  PVE/QemuServer.pm | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 341e0b0..48361d0 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -5898,6 +5898,9 @@ sub restore_archive {
>      } elsif ($archive =~ m/.tar.lzo$/) {
>  	$format = 'tar' if !$format;
>  	$comp = 'lzop';
> +    } elsif ($archive =~ m/\.tar\.zst$/) {
> +	$format = 'tar' if !$format;
> +	$comp = 'zst';
>      } elsif ($archive =~ m/\.vma$/) {
>  	$format = 'vma' if !$format;
>      } elsif ($archive =~ m/\.vma\.gz$/) {
> @@ -5906,6 +5909,9 @@ sub restore_archive {
>      } elsif ($archive =~ m/\.vma\.lzo$/) {
>  	$format = 'vma' if !$format;
>  	$comp = 'lzop';
> +    } elsif ($archive =~ m/\.vma\.zst$/) {
> +	$format = 'vma' if !$format;
> +	$comp = 'zstd';
>      } else {
>  	$format = 'vma' if !$format; # default
>      }
> @@ -6204,6 +6210,8 @@ sub restore_vma_archive {
>  	    $cmd = ['zcat', $readfrom];
>  	} elsif ($comp eq 'lzop') {
>  	    $cmd = ['lzop', '-d', '-c', $readfrom];
> +	} elsif ($comp eq 'zstd') {
> +	    $cmd = ['zstd', '-q', '-d', '-c', $readfrom];
>  	} else {
>  	    die "unknown compression method '$comp'\n";
>  	}
> 





More information about the pve-devel mailing list