tape: remove unused eject_on_unload method
This commit is contained in:
parent
04df41cec1
commit
6638c034d2
|
@ -300,10 +300,6 @@ pub async fn eject_media(drive: String) -> Result<(), Error> {
|
||||||
|
|
||||||
tokio::task::spawn_blocking(move || {
|
tokio::task::spawn_blocking(move || {
|
||||||
if let Some((mut changer, _)) = media_changer(&config, &drive)? {
|
if let Some((mut changer, _)) = media_changer(&config, &drive)? {
|
||||||
if !changer.eject_on_unload() {
|
|
||||||
let mut drive = open_drive(&config, &drive)?;
|
|
||||||
drive.eject_media()?;
|
|
||||||
}
|
|
||||||
changer.unload_media(None)?;
|
changer.unload_media(None)?;
|
||||||
} else {
|
} else {
|
||||||
let mut drive = open_drive(&config, &drive)?;
|
let mut drive = open_drive(&config, &drive)?;
|
||||||
|
|
|
@ -94,16 +94,9 @@ pub trait MediaChange {
|
||||||
self.load_media_from_slot(slot as u64)
|
self.load_media_from_slot(slot as u64)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unload media from drive
|
/// Unload media from drive (eject media if necessary)
|
||||||
///
|
|
||||||
/// This is a nop on drives without autoloader.
|
|
||||||
fn unload_media(&mut self, target_slot: Option<u64>) -> Result<(), Error>;
|
fn unload_media(&mut self, target_slot: Option<u64>) -> Result<(), Error>;
|
||||||
|
|
||||||
/// Returns true if unload_media automatically ejects drive media
|
|
||||||
fn eject_on_unload(&self) -> bool {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// List online media changer IDs (barcodes)
|
/// List online media changer IDs (barcodes)
|
||||||
///
|
///
|
||||||
/// List acessible (online) changer IDs. This does not include
|
/// List acessible (online) changer IDs. This does not include
|
||||||
|
|
|
@ -69,8 +69,4 @@ impl MediaChange for MtxMediaChanger {
|
||||||
self.unload_to_free_slot(status)
|
self.unload_to_free_slot(status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn eject_on_unload(&self) -> bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -454,10 +454,6 @@ impl MediaChange for VirtualTapeHandle {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn eject_on_unload(&self) -> bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
fn clean_drive(&mut self) -> Result<(), Error> {
|
fn clean_drive(&mut self) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -504,10 +500,6 @@ impl MediaChange for VirtualTapeDrive {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn eject_on_unload(&self) -> bool {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
fn online_media_changer_ids(&mut self) -> Result<Vec<String>, Error> {
|
fn online_media_changer_ids(&mut self) -> Result<Vec<String>, Error> {
|
||||||
let handle = self.open()?;
|
let handle = self.open()?;
|
||||||
handle.online_media_changer_ids()
|
handle.online_media_changer_ids()
|
||||||
|
|
Loading…
Reference in New Issue