* [PATCH storage] Fix #7062: import compressed images
@ 2026-07-24 9:49 Serge Logvinov
0 siblings, 0 replies; only message in thread
From: Serge Logvinov @ 2026-07-24 9:49 UTC (permalink / raw)
To: pve-devel; +Cc: serge.logvinov
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>
---
| 4 ++--
| 6 ++++++
2 files changed, 8 insertions(+), 2 deletions(-)
--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};
}
--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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-27 6:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 9:49 [PATCH storage] Fix #7062: import compressed images Serge Logvinov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.