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

Dominik Csapak d.csapak at proxmox.com
Fri Jan 12 08:35:46 CET 2024


On 1/12/24 08:29, Dietmar Maurer wrote:
> 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?

but don't actually know which of the one in the inventory it is?
we only have the label and simple chose the first before, but that might be the wrong one...

>   
>> +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