diff --git a/pbs-tape/src/sg_tape.rs b/pbs-tape/src/sg_tape.rs index 058c14ae..50f5c079 100644 --- a/pbs-tape/src/sg_tape.rs +++ b/pbs-tape/src/sg_tape.rs @@ -1053,22 +1053,18 @@ impl SgTape { /// Tries to write useful attributes to the MAM like Vendor/Application/Version pub fn write_mam_attributes(&mut self, label: Option, pool: Option) { - let version = format!( - "{}-{}", - pbs_buildcfg::PROXMOX_PKG_VERSION, - pbs_buildcfg::PROXMOX_PKG_RELEASE - ); + use pbs_buildcfg::PROXMOX_BACKUP_CRATE_VERSION; let mut attribute_list: Vec<(u16, &[u8])> = vec![ - (0x08_00, b"Proxmox"), - (0x08_01, b"Backup Server"), - (0x08_02, version.as_bytes()), + (0x08_00, b"Proxmox"), // APPLICATION VENDOR, 8 bytes + (0x08_01, b"Proxmox Backup Server"), // APPLICATION NAME, 32 bytes + (0x08_02, PROXMOX_BACKUP_CRATE_VERSION.as_bytes()), // APPLICATION VERSION, 8 bytes ]; if let Some(ref label) = label { - attribute_list.push((0x08_03, label.as_bytes())); + attribute_list.push((0x08_03, label.as_bytes())); // USER MEDIUM TEXT LABEL, 160 bytes } if let Some(ref pool) = pool { - attribute_list.push((0x08_08, pool.as_bytes())); + attribute_list.push((0x08_08, pool.as_bytes())); // MEDIA POOL, 160 bytes } for (id, data) in attribute_list { @@ -1081,7 +1077,6 @@ impl SgTape { // clear all custom set mam attributes fn clear_mam_attributes(&mut self) { for attr in [0x08_00, 0x08_01, 0x08_02, 0x08_03, 0x08_08] { - // ignore error if let Err(err) = write_mam_attribute(&mut self.file, attr, b"") { log::warn!("could not clear MAM attribute {attr:x}: {err}"); }