public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Serge Logvinov <serge.logvinov@sinextra.dev>
To: pve-devel@lists.proxmox.com
Cc: serge.logvinov@sinextra.dev
Subject: [PATCH storage] Fix #7062: import compressed images
Date: Fri, 24 Jul 2026 11:49:37 +0200	[thread overview]
Message-ID: <20260724094949.63365-1-serge.logvinov@sinextra.dev> (raw)

This patch adds support for uploading compressed disk images in gzip, lzo, zst and bz2 formats,
reducing the amount of data transferred.

Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
---
 src/PVE/API2/Storage/Status.pm | 4 ++--
 src/PVE/Storage.pm             | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/PVE/API2/Storage/Status.pm b/src/PVE/API2/Storage/Status.pm
index 741d5144..9578718c 100644
--- a/src/PVE/API2/Storage/Status.pm
+++ b/src/PVE/API2/Storage/Status.pm
@@ -897,8 +897,8 @@ __PACKAGE__->register_method({
 
         my $worker = sub {
             if ($compression) {
-                die "decompression not supported for $content\n" if $content ne 'iso';
-                my $info = PVE::Storage::decompressor_info('iso', $compression);
+                die "decompression not supported for $content\n" if $content ne 'iso' && $content ne 'import';
+                my $info = PVE::Storage::decompressor_info($content, $compression);
                 die "no decompression method found\n" if !$info->{decompressor};
                 $opts->{decompression_command} = $info->{decompressor};
             }
diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm
index 64ea9dad..1e846c2c 100755
--- a/src/PVE/Storage.pm
+++ b/src/PVE/Storage.pm
@@ -1774,6 +1774,12 @@ sub decompressor_info {
             zst => ['zstd', '-q', '-d', '-c'],
             bz2 => ['bzcat', '-q'],
         },
+        import => {
+            gz => ['zcat'],
+            lzo => ['lzop', '-d', '-c'],
+            zst => ['zstd', '-q', '-d', '-c'],
+            bz2 => ['bzcat', '-q'],
+        },
     };
 
     die "ERROR: archive format not defined\n"
-- 
2.50.1 (Apple Git-155)




                 reply	other threads:[~2026-07-27  6:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260724094949.63365-1-serge.logvinov@sinextra.dev \
    --to=serge.logvinov@sinextra.dev \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal