From 8e3e83318b73e54c34c734f5017fbe7d3b187a03 Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Thu, 10 Aug 2023 17:37:04 +0200 Subject: [PATCH] fix: api-types: add support for lto 9 tape density lto 9 tapes have a new density code which leads to these tapes not being recognized properly. add the new density code and TapeDensity to improve lto 9 support. since the documentation states that we support lto 5 and above this constitutes a bug fix for lto 9 support. Signed-off-by: Stefan Sterz --- pbs-api-types/src/tape/drive.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pbs-api-types/src/tape/drive.rs b/pbs-api-types/src/tape/drive.rs index d841505a..ea2cbbd8 100644 --- a/pbs-api-types/src/tape/drive.rs +++ b/pbs-api-types/src/tape/drive.rs @@ -130,6 +130,8 @@ pub enum TapeDensity { LTO7M8, /// LTO8 LTO8, + /// LTO9 + LTO9, } impl TryFrom for TapeDensity { @@ -147,6 +149,7 @@ impl TryFrom for TapeDensity { 0x5c => TapeDensity::LTO7, 0x5d => TapeDensity::LTO7M8, 0x5e => TapeDensity::LTO8, + 0x60 => TapeDensity::LTO9, _ => bail!("unknown tape density code 0x{:02x}", value), }; Ok(density)