From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 374861FF187 for <inbox@lore.proxmox.com>; Wed, 9 Apr 2025 16:26:31 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8FBDE9F19; Wed, 9 Apr 2025 16:26:23 +0200 (CEST) From: Filip Schauer <f.schauer@proxmox.com> To: pve-devel@lists.proxmox.com Date: Wed, 9 Apr 2025 16:24:12 +0200 Message-Id: <20250409142423.130540-2-f.schauer@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250409142423.130540-1-f.schauer@proxmox.com> References: <20250409142423.130540-1-f.schauer@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.017 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [storage.pm, hookscript.pl] Subject: [pve-devel] [PATCH storage 01/12] add support for .vma.bz2 X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> This aligns with the PVE::Storage::BACKUP_EXT_RE_2 regex Signed-off-by: Filip Schauer <f.schauer@proxmox.com> --- src/PVE/Storage.pm | 11 +++++++++-- src/test/list_volumes_test.pm | 10 ++++++++++ src/test/parse_volname_test.pm | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm index d0a696a..6031261 100755 --- a/src/PVE/Storage.pm +++ b/src/PVE/Storage.pm @@ -1720,13 +1720,20 @@ sub extract_vzdump_config_vma { if ($comp) { my $cmd = [ [@$decompressor, $archive], ["vma", "config", "-"] ]; - # lzop/zcat exits with 1 when the pipe is closed early by vma, detect this and ignore the exit code later + # lzop/zcat/zstd/bzcat exits with 1 when the pipe is closed early by vma, + # detect this and ignore the exit code later my $broken_pipe; my $errstring; my $err = sub { my $output = shift; - if ($output =~ m/lzop: Broken pipe: <stdout>/ || $output =~ m/gzip: stdout: Broken pipe/ || $output =~ m/zstd: error 70 : Write error.*Broken pipe/) { + if ( + $output =~ m/lzop: Broken pipe: <stdout>/ + || $output =~ m/gzip: stdout: Broken pipe/ + || $output =~ m/zstd: error 70 : Write error.*Broken pipe/ + || $output =~ m/bzcat: Broken pipe/ + ) { $broken_pipe = 1; + $errstring = ""; } elsif (!defined ($errstring) && $output !~ m/^\s*$/) { $errstring = "Failed to extract config from VMA archive: $output\n"; } diff --git a/src/test/list_volumes_test.pm b/src/test/list_volumes_test.pm index 7b6df6a..5adba03 100644 --- a/src/test/list_volumes_test.pm +++ b/src/test/list_volumes_test.pm @@ -94,6 +94,7 @@ my @tests = ( "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_12_45.vma.lzo", "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_13_55.vma", "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_13_55.vma.zst", + "$storage_dir/dump/vzdump-qemu-16110-2020_03_30-21_15_00.vma.bz2", "$storage_dir/snippets/userconfig.yaml", "$storage_dir/snippets/hookscript.pl", ], @@ -164,6 +165,15 @@ my @tests = ( 'vmid' => '16110', 'volid' => 'local:backup/vzdump-qemu-16110-2020_03_30-21_13_55.vma.zst', }, + { + 'content' => 'backup', + 'ctime' => 1585602900, + 'format' => 'vma.bz2', + 'size' => DEFAULT_SIZE, + 'subtype' => 'qemu', + 'vmid' => '16110', + 'volid' => 'local:backup/vzdump-qemu-16110-2020_03_30-21_15_00.vma.bz2', + }, { 'content' => 'snippets', 'ctime' => DEFAULT_CTIME, diff --git a/src/test/parse_volname_test.pm b/src/test/parse_volname_test.pm index 175500d..0ede982 100644 --- a/src/test/parse_volname_test.pm +++ b/src/test/parse_volname_test.pm @@ -214,7 +214,7 @@ foreach my $s (@$disk_suffix) { # create more test cases for backup files matches my $bkp_suffix = { - qemu => [ 'vma', 'vma.gz', 'vma.lzo', 'vma.zst' ], + qemu => [ 'vma', 'vma.gz', 'vma.lzo', 'vma.zst', 'vma.bz2' ], lxc => [ 'tar', 'tgz', 'tar.gz', 'tar.lzo', 'tar.zst', 'tar.bz2' ], openvz => [ 'tar', 'tgz', 'tar.gz', 'tar.lzo', 'tar.zst' ], }; -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel