tape: MediaChange - add transfer, implement export

This commit is contained in:
Dietmar Maurer
2021-01-10 11:51:09 +01:00
parent e6217b8b36
commit 0057f0e580
3 changed files with 56 additions and 1 deletions

View File

@ -393,6 +393,10 @@ impl MediaChange for VirtualTapeHandle {
Ok(MtxStatus { drives, slots })
}
fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error> {
bail!("medfia tranfer is not implemented!");
}
fn load_media_from_slot(&mut self, slot: u64) -> Result<(), Error> {
if slot < 1 {
bail!("invalid slot ID {}", slot);
@ -452,6 +456,11 @@ impl MediaChange for VirtualTapeDrive {
handle.status()
}
fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error> {
let mut handle = self.open()?;
handle.transfer(from, to)
}
fn load_media_from_slot(&mut self, slot: u64) -> Result<(), Error> {
let mut handle = self.open()?;
handle.load_media_from_slot(slot)