tape: simplify export_media_set for pool writer

our export code can handle if the tape is inside the drive, so unloading
it first does not have an benefit, it even makes the exporting slower,
since we first unload it into its original slot, and then moving it
to an import/export slot

so drop the code that unloads the tape from the drive, and let the
export code itself handle that

change the 'eject' into a 'rewind' and comment why we do that first

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-10-18 11:24:12 +02:00 committed by Dietmar Maurer
parent 1d4448998a
commit 6b8329ee34

View File

@ -157,14 +157,12 @@ impl PoolWriter {
if let Some((mut changer, _)) = media_changer(&drive_config, &self.drive_name)? {
if let Some(ref mut status) = status {
task_log!(worker, "eject media");
status.drive.eject_media()?; // rewind and eject early, so that unload_media is faster
task_log!(worker, "rewind media");
// rewind first so that the unload command later does not run into a timeout
status.drive.rewind()?;
}
drop(status); // close drive
task_log!(worker, "unload media");
changer.unload_media(None)?;
for media_uuid in self.pool.current_media_list()? {
let media = self.pool.lookup_media(media_uuid)?;
let label_text = media.label_text();