5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-03-07 00:58:32 +03:00

tape: continue without MAM media_usage page

sometimes we cannot parse these pages (e.g. vendor quirks that implement
the field differently)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-03-30 13:28:43 +02:00 committed by Dietmar Maurer
parent 6fa3ab297f
commit a7900d6e0b

View File

@ -911,11 +911,16 @@ impl SgTape {
status.block_number = Some(position.logical_object_number);
if let Ok(mam) = self.cartridge_memory() {
let usage = mam_extract_media_usage(&mam)?;
status.manufactured = Some(usage.manufactured);
status.bytes_read = Some(usage.bytes_read);
status.bytes_written = Some(usage.bytes_written);
match mam_extract_media_usage(&mam) {
Ok(usage) => {
status.manufactured = Some(usage.manufactured);
status.bytes_read = Some(usage.bytes_read);
status.bytes_written = Some(usage.bytes_written);
}
Err(err) => {
log::warn!("unable to get MAM media usage: {err}");
}
}
if let Ok(volume_stats) = self.volume_statistics() {
let passes = std::cmp::max(