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

Alwin Antreich a.antreich at proxmox.com
Fri Jun 14 15:37:31 CEST 2019


Recognize the .zst file extention for the zstd de-compression

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";
 	}
-- 
2.11.0





More information about the pve-devel mailing list