public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox{,-backup} 0/2] tape: add support for LTO10 densities
@ 2026-12-03 15:06 Dominik Csapak
  2026-12-03 15:06 ` [PATCH proxmox 1/2] pbs api types: tape: add lto10 densities Dominik Csapak
  2026-12-03 15:06 ` [PATCH proxmox-backup 2/2] tape: don't fail on unknown reported density Dominik Csapak
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-12-03 15:06 UTC (permalink / raw)
  To: pbs-devel

With an LTO10 tape loaded, querying the drive status (API, GUI and
`pmt status`) fails, since the reported density code is unknown to the
TapeDensity enum.

The proxmox patch adds the density codes for LTO10 (0x62) and the 40 TB
LTO10 Premium cartridges (0x63). Since they sort after LTO9, formatting
such media also takes the LTO9+ code path instead of falling back to a
plain erase.

The proxmox-backup patch makes the status query fall back to 'unknown'
for unrecognized density codes, like format_media already does, so
future generations do not break the status query again. It does not
depend on the proxmox patch.

I couldn't test on real hardware since I don't have access to an LTO10 drive
yet, but I tested via a VTL that can emulate the density code.


proxmox:

Dominik Csapak (1):
  pbs api types: tape: add lto10 densities

 pbs-api-types/src/tape/drive.rs | 6 ++++++
 1 file changed, 6 insertions(+)


proxmox-backup:

Dominik Csapak (1):
  tape: don't fail on unknown reported density

 pbs-tape/src/sg_tape.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


Summary over all repositories:
  2 files changed, 10 insertions(+), 1 deletions(-)

-- 
Generated by murpp 0.11.0




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH proxmox 1/2] pbs api types: tape: add lto10 densities
  2026-12-03 15:06 [PATCH proxmox{,-backup} 0/2] tape: add support for LTO10 densities Dominik Csapak
@ 2026-12-03 15:06 ` Dominik Csapak
  2026-12-03 15:06 ` [PATCH proxmox-backup 2/2] tape: don't fail on unknown reported density Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-12-03 15:06 UTC (permalink / raw)
  To: pbs-devel

Without these, querying the drive status (e.g. via the API or
`pmt status`) fails with an LTO10 tape loaded, since the reported
density code cannot be parsed.

This also lets LTO10 media take the LTO9+ code path when formatting,
instead of falling back to a plain erase.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 pbs-api-types/src/tape/drive.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pbs-api-types/src/tape/drive.rs b/pbs-api-types/src/tape/drive.rs
index 9f7599ba..afb18c29 100644
--- a/pbs-api-types/src/tape/drive.rs
+++ b/pbs-api-types/src/tape/drive.rs
@@ -139,6 +139,10 @@ pub enum TapeDensity {
     LTO8,
     /// LTO9
     LTO9,
+    /// LTO10
+    LTO10,
+    /// LTO10 Premium
+    LTO10P,
     #[cfg(feature = "enum-fallback")]
     #[serde(untagged)]
     UnknownEnumValue(FixedString),
@@ -160,6 +164,8 @@ impl TryFrom<u8> for TapeDensity {
             0x5d => TapeDensity::LTO7M8,
             0x5e => TapeDensity::LTO8,
             0x60 => TapeDensity::LTO9,
+            0x62 => TapeDensity::LTO10,
+            0x63 => TapeDensity::LTO10P,
             _ => bail!("unknown tape density code 0x{:02x}", value),
         };
         Ok(density)
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH proxmox-backup 2/2] tape: don't fail on unknown reported density
  2026-12-03 15:06 [PATCH proxmox{,-backup} 0/2] tape: add support for LTO10 densities Dominik Csapak
  2026-12-03 15:06 ` [PATCH proxmox 1/2] pbs api types: tape: add lto10 densities Dominik Csapak
@ 2026-12-03 15:06 ` Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-12-03 15:06 UTC (permalink / raw)
  To: pbs-devel

Whenever a new LTO standard is released (and sometimes in between
versions), a new tape density code is used to represent a generation of
tapes.

Querying the drive and media status bails out on such unknown codes,
which breaks the status API and `pmt status` until the code is added.

Fall back to 'unknown' instead, like format_media already does. Code
paths that depend on the density might then take a non-optimal path,
but should still work.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 pbs-tape/src/sg_tape.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pbs-tape/src/sg_tape.rs b/pbs-tape/src/sg_tape.rs
index a98e8960a..185a63c14 100644
--- a/pbs-tape/src/sg_tape.rs
+++ b/pbs-tape/src/sg_tape.rs
@@ -1109,7 +1109,10 @@ impl SgTape {
             blocksize: drive_status.block_length,
             compression: drive_status.compression,
             buffer_mode: drive_status.buffer_mode,
-            density: drive_status.density_code.try_into()?,
+            density: drive_status
+                .density_code
+                .try_into()
+                .unwrap_or(TapeDensity::Unknown),
             alert_flags,
             write_protect: None,
             file_number: None,
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-03 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 15:06 [PATCH proxmox{,-backup} 0/2] tape: add support for LTO10 densities Dominik Csapak
2026-12-03 15:06 ` [PATCH proxmox 1/2] pbs api types: tape: add lto10 densities Dominik Csapak
2026-12-03 15:06 ` [PATCH proxmox-backup 2/2] tape: don't fail on unknown reported density Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal