From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 31509916A2 for ; Thu, 4 Apr 2024 11:49:55 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1A04F3604F for ; Thu, 4 Apr 2024 11:49:55 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 4 Apr 2024 11:49:54 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 46F7A45204 for ; Thu, 4 Apr 2024 11:49:54 +0200 (CEST) Date: Thu, 04 Apr 2024 11:49:47 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: <20240328123707.336951-1-c.ebner@proxmox.com> <20240328123707.336951-31-c.ebner@proxmox.com> In-Reply-To: <20240328123707.336951-31-c.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1712223826.oqotconz8r.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.059 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 Subject: Re: [pbs-devel] [PATCH v3 proxmox-backup 30/58] catalog: shell: redirect payload reader for split streams X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2024 09:49:55 -0000 On March 28, 2024 1:36 pm, Christian Ebner wrote: > 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. >=20 > Signed-off-by: Christian Ebner > --- > changes since version 2: > - use mpxar and ppxar file extensions > - use pxar fuse reader helper >=20 > proxmox-backup-client/src/catalog.rs | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) >=20 > 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<(), E= rror> { > } > }; > =20 > - let server_archive_name =3D if archive_name.ends_with(".pxar") { > + let server_archive_name =3D if archive_name.ends_with(".pxar") > + || archive_name.ends_with(".mpxar") > + || archive_name.ends_with(".ppxar") > + { as with mount - there is a call to get_pxar_archive_names betwee this hunk and the next one (introduced by the previous patch), shouldn't that just be moved up here? > format!("{}.didx", archive_name) > } else { > bail!("Can only mount pxar archives."); > @@ -216,7 +219,18 @@ async fn catalog_shell(param: Value) -> Result<(), E= rror> { > ) > .await?; > =20 > - let decoder =3D pbs_pxar_fuse::Accessor::new(reader, archive_size).a= wait?; > + let decoder =3D if let Some(payload_archive_name) =3D payload_archiv= e_name { > + let (payload_reader, _) =3D 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? > + }; we have this exact pattern twice at least as well, once for mount, once for the catalog.. in fact, all four calls to helpers::get_pxar_fuse_reader are in those two call sites, so probably the helper should just be that whole sequence instead (or the existing helper made internal to a new helper for this sequence)? :) > =20 > client.download(CATALOG_NAME, &mut tmpfile).await?; > let index =3D DynamicIndexReader::new(tmpfile) > --=20 > 2.39.2 >=20 >=20 >=20 > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel >=20 >=20 >=20