[pbs-devel] [PATCH v3 proxmox-backup 30/58] catalog: shell: redirect payload reader for split streams

Christian Ebner c.ebner at proxmox.com
Thu Mar 28 13:36:39 CET 2024


Allows to attach to pxar archives with split metadata and payload
streams, by redirecting the payload input to a dedicated reader
accessing the payload index.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 2:
- use mpxar and ppxar file extensions
- use pxar fuse reader helper

 proxmox-backup-client/src/catalog.rs | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/proxmox-backup-client/src/catalog.rs b/proxmox-backup-client/src/catalog.rs
index 2073e058d..3e52880b9 100644
--- a/proxmox-backup-client/src/catalog.rs
+++ b/proxmox-backup-client/src/catalog.rs
@@ -181,7 +181,10 @@ async fn catalog_shell(param: Value) -> Result<(), Error> {
         }
     };
 
-    let server_archive_name = if archive_name.ends_with(".pxar") {
+    let server_archive_name = if archive_name.ends_with(".pxar")
+        || archive_name.ends_with(".mpxar")
+        || archive_name.ends_with(".ppxar")
+    {
         format!("{}.didx", archive_name)
     } else {
         bail!("Can only mount pxar archives.");
@@ -216,7 +219,18 @@ async fn catalog_shell(param: Value) -> Result<(), Error> {
     )
     .await?;
 
-    let decoder = pbs_pxar_fuse::Accessor::new(reader, archive_size).await?;
+    let decoder = if let Some(payload_archive_name) = payload_archive_name {
+        let (payload_reader, _) = helper::get_pxar_fuse_reader(
+            &payload_archive_name,
+            client.clone(),
+            &manifest,
+            crypt_config.clone(),
+        )
+        .await?;
+        pbs_pxar_fuse::Accessor::new(reader, archive_size, Some(payload_reader)).await?
+    } else {
+        pbs_pxar_fuse::Accessor::new(reader, archive_size, None).await?
+    };
 
     client.download(CATALOG_NAME, &mut tmpfile).await?;
     let index = DynamicIndexReader::new(tmpfile)
-- 
2.39.2





More information about the pbs-devel mailing list