public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Filip Schauer <f.schauer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH vma-to-pbs 12/12] add support for xz compressed VMA files
Date: Wed,  9 Apr 2025 16:24:23 +0200	[thread overview]
Message-ID: <20250409142423.130540-13-f.schauer@proxmox.com> (raw)
In-Reply-To: <20250409142423.130540-1-f.schauer@proxmox.com>

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
 src/main.rs    | 3 ++-
 src/vma2pbs.rs | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index 5d7c3bf..03dd64f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -254,7 +254,7 @@ fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
 
     let grouped_vmas = if let Some(dump_dir_path) = bulk {
         let re = Regex::new(
-            r"vzdump-qemu-(\d+)-(\d{4}_\d{2}_\d{2}-\d{2}_\d{2}_\d{2}).vma(|.zst|.lzo|.gz|.bz2)$",
+            r"vzdump-qemu-(\d+)-(\d{4}_\d{2}_\d{2}-\d{2}_\d{2}_\d{2}).vma(|.zst|.lzo|.gz|.xz|.bz2)$",
         )?;
 
         let mut vmas = Vec::new();
@@ -291,6 +291,7 @@ fn parse_args() -> Result<BackupVmaToPbsArgs, Error> {
                     ".zst" => Some(Compression::Zstd),
                     ".lzo" => Some(Compression::Lzo),
                     ".gz" => Some(Compression::GZip),
+                    ".xz" => Some(Compression::XZ),
                     ".bz2" => Some(Compression::BZip2),
                     _ => bail!("Unexpected file extension: {ext}"),
                 };
diff --git a/src/vma2pbs.rs b/src/vma2pbs.rs
index a27a07d..d8ccf84 100644
--- a/src/vma2pbs.rs
+++ b/src/vma2pbs.rs
@@ -53,6 +53,7 @@ pub enum Compression {
     Zstd,
     Lzo,
     GZip,
+    XZ,
     BZip2,
 }
 
@@ -534,6 +535,11 @@ fn upload_vma_file(pbs_args: &PbsArgs, backup_args: &VmaBackupArgs) -> Result<()
                     cmd
                 }
                 Compression::GZip => Command::new("zcat"),
+                Compression::XZ => {
+                    let mut cmd = Command::new("xzcat");
+                    cmd.args(["-q"]);
+                    cmd
+                }
                 Compression::BZip2 => {
                     let mut cmd = Command::new("bzcat");
                     cmd.args(["-q"]);
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


      parent reply	other threads:[~2025-04-09 14:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 14:24 [pve-devel] [PATCH guest-common/manager/storage/vma-to-pbs 00/12] align supported compression formats for templates and backups Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH storage 01/12] add support for .vma.bz2 Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH storage 02/12] add support for xz compressed VM and container backups Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH storage 03/12] align supported compression formats for templates and backups Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH guest-common 04/12] vzdump: add support for bzip2 compression Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH guest-common 05/12] vzdump: add support for xz compression Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH manager 06/12] accept .tar.bz2 ct templates in the storage upload dialog Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH manager 07/12] vzdump: add support for bzip2 compression Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH manager 08/12] vzdump: add support for xz compression Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH manager 09/12] allow download of xz compressed files Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH manager 10/12] accept .tar.lzo ct templates in the storage upload dialog Filip Schauer
2025-04-09 14:24 ` [pve-devel] [PATCH vma-to-pbs 11/12] add support for bzip2 compressed VMA files Filip Schauer
2025-04-09 14:24 ` Filip Schauer [this message]

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=20250409142423.130540-13-f.schauer@proxmox.com \
    --to=f.schauer@proxmox.com \
    --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