api: tape: add lto9 initialization message to task log

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

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-12-12 12:32:48 +01:00 committed by Dietmar Maurer
parent 0b1a30aa39
commit 47da06beed

View File

@ -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 {