public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 4/4] api: tape: add lto9 initialization message to task log
Date: Tue, 12 Dec 2023 12:32:48 +0100	[thread overview]
Message-ID: <20231212113248.159105-5-d.csapak@proxmox.com> (raw)
In-Reply-To: <20231212113248.159105-1-d.csapak@proxmox.com>

so that it's clear that this operation can take a while

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/api2/tape/drive.rs | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/api2/tape/drive.rs b/src/api2/tape/drive.rs
index 5306e605..3a77ca6f 100644
--- a/src/api2/tape/drive.rs
+++ b/src/api2/tape/drive.rs
@@ -16,7 +16,7 @@ use proxmox_uuid::Uuid;
 
 use pbs_api_types::{
     Authid, DriveListEntry, LabelUuidMap, Lp17VolumeStatistics, LtoDriveAndMediaStatus,
-    LtoTapeDrive, MamAttribute, MediaIdFlat, CHANGER_NAME_SCHEMA, DRIVE_NAME_SCHEMA,
+    LtoTapeDrive, MamAttribute, MediaIdFlat, TapeDensity, CHANGER_NAME_SCHEMA, DRIVE_NAME_SCHEMA,
     MEDIA_LABEL_SCHEMA, MEDIA_POOL_NAME_SCHEMA, UPID_SCHEMA,
 };
 
@@ -309,6 +309,21 @@ pub fn format_media(
 
             let mut handle = open_drive(&config, &drive)?;
 
+            if !fast.unwrap_or(true) {
+                let drive_config: LtoTapeDrive = config.lookup("lto", &drive)?;
+                let file = open_lto_tape_device(&drive_config.path)?;
+                let mut handle = LtoTapeHandle::new(file)?;
+                if let Ok(status) = handle.get_drive_and_media_status() {
+                    if status.density >= TapeDensity::LTO9 {
+                        task_log!(worker, "Slow formatting LTO9+ media.");
+                        task_log!(
+                            worker,
+                            "This can take a very long time due to media optimization."
+                        );
+                    }
+                }
+            }
+
             match handle.read_label() {
                 Err(err) => {
                     if let Some(label) = label_text {
-- 
2.39.2




  parent reply	other threads:[~2023-12-12 11:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 11:32 [pbs-devel] [PATCH proxmox-backup 0/4] better handle lto9 format Dominik Csapak
2023-12-12 11:32 ` [pbs-devel] [PATCH proxmox-backup 1/4] tape: add optional timeout to wait_until_ready Dominik Csapak
2023-12-12 11:32 ` [pbs-devel] [PATCH proxmox-backup 2/4] tape: derive PartialEq and PartialOrd for TapeDensity Dominik Csapak
2023-12-12 11:32 ` [pbs-devel] [PATCH proxmox-backup 3/4] tape: adapt format_media for LTO9+ Dominik Csapak
2023-12-12 11:32 ` Dominik Csapak [this message]
2023-12-12 12:37 ` [pbs-devel] applied: [PATCH proxmox-backup 0/4] better handle lto9 format Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231212113248.159105-5-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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