[pbs-devel] [PATCH proxmox-backup 1/5] tape: handle duplicate label-texts in inventory

Dietmar Maurer dietmar at proxmox.com
Fri Jan 12 08:29:18 CET 2024


I am confused about insert_into_online_set(). We now do not add
the media to the MtxStatus, although the media is detected, only because there is another tape with the same label?

That is far more confusing than before, isnt it?
 
> +fn insert_into_online_set(inventory: &Inventory, label_text: &str, online_set: &mut HashSet<Uuid>) {
> +    match inventory.find_media_by_label_text(&label_text) {
> +        Ok(Some(media_id)) => {
> +            online_set.insert(media_id.label.uuid.clone());
> +        }
> +        Ok(None) => {}
> +        Err(err) => log::warn!("error getting media by unique label: {err}"),
> +    }
> +}
> +
>  /// Extract the list of online media from MtxStatus
>  ///
>  /// Returns a HashSet containing all found media Uuid. This only
> @@ -96,9 +106,7 @@ pub fn mtx_status_to_online_set(status: &MtxStatus, inventory: &Inventory) -> Ha
>




More information about the pbs-devel mailing list