tape: add pmt weof

This commit is contained in:
Dietmar Maurer
2021-01-31 17:33:07 +01:00
parent 28f60e5291
commit 83b8949a98
3 changed files with 54 additions and 8 deletions

View File

@ -193,6 +193,16 @@ impl LinuxTapeHandle {
Ok(())
}
pub fn mtop(&mut self, mt_op: MTCmd, mt_count: i32, msg: &str) -> Result<(), Error> {
let cmd = mtop { mt_op, mt_count };
unsafe {
mtioctop(self.file.as_raw_fd(), &cmd)
}.map_err(|err| format_err!("{} failed (count {}) - {}", msg, mt_count, err))?;
Ok(())
}
pub fn mtload(&mut self) -> Result<(), Error> {
let cmd = mtop { mt_op: MTCmd::MTLOAD, mt_count: 1, };

View File

@ -1,7 +1,8 @@
//! Tape drivers
mod virtual_tape;
mod linux_mtio;
pub mod linux_mtio;
mod tape_alert_flags;
pub use tape_alert_flags::*;