tape: set media status if we detect damaged medium at start of backup

This commit is contained in:
Dietmar Maurer 2021-02-26 09:00:50 +01:00
parent 0023cfa385
commit 25350f3370
2 changed files with 4 additions and 0 deletions

View File

@ -126,6 +126,9 @@ impl MediaPool {
self.encrypt_fingerprint.clone()
}
pub fn set_media_status_damaged(&mut self, uuid: &Uuid) -> Result<(), Error> {
self.inventory.set_media_status_damaged(uuid)
}
fn compute_media_state(&self, media_id: &MediaId) -> (MediaStatus, MediaLocation) {

View File

@ -225,6 +225,7 @@ impl PoolWriter {
if !alert_flags.is_empty() {
worker.log(format!("TapeAlertFlags: {:?}", alert_flags));
if tape_alert_flags_critical(alert_flags) {
self.pool.set_media_status_damaged(&media_uuid)?;
bail!("aborting due to critical tape alert flags: {:?}", alert_flags);
}
}