Add support for lzma, zstd and auto detection of compression methods.

Removed "auto" setting and updated documentation since v1.

Signed-off-by: Zixun LI <ad...@hifiphile.com>
---
 daemon/tar.c              |  8 ++++++++
 generator/actions_core.ml | 12 ++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/daemon/tar.c b/daemon/tar.c
index 57b5b37ff..ff29fe500 100644
--- a/daemon/tar.c
+++ b/daemon/tar.c
@@ -159,6 +159,10 @@ do_tar_in (const char *dir, const char *compress, int 
xattrs, int selinux, int a
       filter = " --xz";
     else if (STREQ (compress, "lzop"))
       filter = " --lzop";
+    else if (STREQ (compress, "lzma"))
+      filter = " --lzma";
+    else if (STREQ (compress, "zstd"))
+      filter = " --zstd";
     else {
       reply_with_error ("unknown compression type: %s", compress);
       return -1;
@@ -312,6 +316,10 @@ do_tar_out (const char *dir, const char *compress, int 
numericowner,
       filter = " --xz";
     else if (STREQ (compress, "lzop"))
       filter = " --lzop";
+    else if (STREQ (compress, "lzma"))
+      filter = " --lzma";
+    else if (STREQ (compress, "zstd"))
+      filter = " --zstd";
     else {
       reply_with_error ("unknown compression type: %s", compress);
       return -1;
diff --git a/generator/actions_core.ml b/generator/actions_core.ml
index c8d9949ba..273ea1a7f 100644
--- a/generator/actions_core.ml
+++ b/generator/actions_core.ml
@@ -2710,9 +2710,9 @@ This command uploads and unpacks local file C<tarfile> 
into F<directory>.
 The optional C<compress> flag controls compression.  If not given,
 then the input should be an uncompressed tar file.  Otherwise one
 of the following strings may be given to select the compression
-type of the input file: C<compress>, C<gzip>, C<bzip2>, C<xz>, C<lzop>.
-(Note that not all builds of libguestfs will support all of these
-compression types).
+type of the input file: C<compress>, C<gzip>, C<bzip2>, C<xz>, C<lzop>, 
+C<lzma>, C<zstd>.  (Note that not all builds of libguestfs will support
+all of these compression types).
 
 The other optional arguments are:
 
@@ -2745,9 +2745,9 @@ it to local file C<tarfile>.
 The optional C<compress> flag controls compression.  If not given,
 then the output will be an uncompressed tar file.  Otherwise one
 of the following strings may be given to select the compression
-type of the output file: C<compress>, C<gzip>, C<bzip2>, C<xz>, C<lzop>.
-(Note that not all builds of libguestfs will support all of these
-compression types).
+type of the output file: C<compress>, C<gzip>, C<bzip2>, C<xz>, C<lzop>,
+C<lzma>, C<zstd>.  (Note that not all builds of libguestfs will support
+all of these compression types).
 
 The other optional arguments are:
 
-- 
2.40.1

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to