5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-18 06:03:59 +03:00

tape: fix read element status for some changers

It seems some changers are setting the PVolTag/AVolTag flags in the
ELEMENT STATUS page response, but don't include the actual fields then.
To make it work with such changers, downgrade the errors to warnings, so
we can continue to decode the remaining data.

This is OK since one volume tag is optional and the other is skipped
anyway.

Reported in the forum:
https://forum.proxmox.com/threads/hpe-storeonce-vtl.152547/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2024-08-26 16:04:59 +02:00 committed by Dietmar Maurer
parent dc0de0db10
commit e97132bb64

View File

@ -746,9 +746,18 @@ fn decode_element_status_page(
let desc: TransportDescriptor = unsafe { reader.read_be_value()? };
let full = (desc.flags1 & 1) != 0;
let volume_tag = subhead.parse_optional_volume_tag(&mut reader, full)?;
subhead.skip_alternate_volume_tag(&mut reader)?;
let volume_tag = match subhead.parse_optional_volume_tag(&mut reader, full) {
Ok(tag) => tag,
Err(err) => {
log::warn!("could not read optional volume tag: {err}");
None
}
};
if let Err(err) = subhead.skip_alternate_volume_tag(&mut reader) {
log::warn!("could not skip alternate volume tag: {err}");
}
result.last_element_address = Some(desc.element_address);