public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox-backup v2 2/8] tape/media_catalog: add helpers to look for snapshot/chunk files
Date: Thu, 6 May 2021 07:59:44 +0200	[thread overview]
Message-ID: <204be9e4-f481-3439-af34-6c41026b9455@proxmox.com> (raw)
In-Reply-To: <20210505100918.506-3-d.csapak@proxmox.com>

applied

On 5/5/21 12:09 PM, Dominik Csapak wrote:
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>   src/tape/media_catalog.rs | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
>
> diff --git a/src/tape/media_catalog.rs b/src/tape/media_catalog.rs
> index aff91c43..8be97a36 100644
> --- a/src/tape/media_catalog.rs
> +++ b/src/tape/media_catalog.rs
> @@ -924,6 +924,16 @@ impl MediaSetCatalog {
>           false
>       }
>   
> +    /// Returns the media uuid and snapshot archive file number
> +    pub fn lookup_snapshot(&self, store: &str, snapshot: &str) -> Option<(&Uuid, u64)> {
> +        for (uuid, catalog) in self.catalog_list.iter() {
> +            if let Some(nr) = catalog.lookup_snapshot(store, snapshot) {
> +                return Some((uuid, nr));
> +            }
> +        }
> +        None
> +    }
> +
>       /// Test if the catalog already contain a chunk
>       pub fn contains_chunk(&self, store: &str, digest: &[u8;32]) -> bool {
>           for catalog in self.catalog_list.values() {
> @@ -933,6 +943,16 @@ impl MediaSetCatalog {
>           }
>           false
>       }
> +
> +    /// Returns the media uuid and chunk archive file number
> +    pub fn lookup_chunk(&self, store: &str, digest: &[u8;32]) -> Option<(&Uuid, u64)> {
> +        for (uuid, catalog) in self.catalog_list.iter() {
> +            if let Some(nr) = catalog.lookup_chunk(store, digest) {
> +                return Some((uuid, nr));
> +            }
> +        }
> +        None
> +    }
>   }
>   
>   // Type definitions for internal binary catalog encoding




  reply	other threads:[~2021-05-06  6:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 10:09 [pbs-devel] [PATCH proxmox-backup v2 0/8] tape: single snapshot restore Dominik Csapak
2021-05-05 10:09 ` [pbs-devel] [PATCH proxmox-backup v2 1/8] tape/drive: add 'move_to_file' to TapeDriver trait Dominik Csapak
2021-05-06  5:56   ` [pbs-devel] applied: " Dietmar Maurer
2021-05-05 10:09 ` [pbs-devel] [PATCH proxmox-backup v2 2/8] tape/media_catalog: add helpers to look for snapshot/chunk files Dominik Csapak
2021-05-06  5:59   ` Dietmar Maurer [this message]
2021-05-05 10:09 ` [pbs-devel] [PATCH proxmox-backup v2 3/8] api2/tape/restore: factor out check_datastore_privs Dominik Csapak
2021-05-06  6:01   ` [pbs-devel] applied: " Dietmar Maurer
2021-05-05 10:09 ` [pbs-devel] [PATCH proxmox-backup v2 4/8] api2/tape/restore: remove unnecessary params from (try_)restore_snapshot_archive Dominik Csapak
2021-05-06  6:02   ` [pbs-devel] applied: " Dietmar Maurer
2021-05-05 10:09 ` [pbs-devel] [PATCH proxmox-backup v2 5/8] api2/tape/restore: return backup manifest in try_restore_snapshot_archive Dominik Csapak
2021-05-05 10:09 ` [pbs-devel] [PATCH proxmox-backup v2 6/8] api2/tape/restore: add 'restore-single' api path Dominik Csapak
2021-05-05 10:53   ` Thomas Lamprecht
2021-05-05 12:48     ` Dominik Csapak
2021-05-05 10:09 ` [pbs-devel] [PATCH proxmox-backup v2 7/8] bin/proxmox-tape: add restore-single command to proxmox-tape Dominik Csapak
2021-05-05 11:04   ` Thomas Lamprecht
2021-05-05 12:50     ` Dominik Csapak
2021-05-05 10:09 ` [pbs-devel] [PATCH proxmox-backup v2 8/8] ui: tape: add single snapshot restore Dominik Csapak

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=204be9e4-f481-3439-af34-6c41026b9455@proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-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