From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 16ABF1FF0E1 for ; Mon, 27 Jul 2026 08:34:34 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 03CBE213E5; Mon, 27 Jul 2026 08:34:32 +0200 (CEST) X-Pm-Submission-Id: 4h63BX3r9Qz1DFgp From: Serge Logvinov To: pve-devel@lists.proxmox.com Subject: [PATCH storage] Fix #7062: import compressed images Date: Fri, 24 Jul 2026 11:49:37 +0200 Message-ID: <20260724094949.63365-1-serge.logvinov@sinextra.dev> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 DMARC_PASS -0.1 DMARC pass policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record X-MailFrom: serge.logvinov@sinextra.dev X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: TYOLDL7XMVCC2P4WEWBJNDPE6L7456UE X-Message-ID-Hash: TYOLDL7XMVCC2P4WEWBJNDPE6L7456UE X-Mailman-Approved-At: Mon, 27 Jul 2026 08:34:30 +0200 CC: serge.logvinov@sinextra.dev X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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)