public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] tape: simplify export_media_set for pool writer
@ 2021-10-15  8:32 Dominik Csapak
  2021-10-15  8:32 ` [pbs-devel] [PATCH proxmox-backup 2/2] tape: improve export_media error message for not found tape Dominik Csapak
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Csapak @ 2021-10-15  8:32 UTC (permalink / raw)
  To: pbs-devel

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

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
tested on my virtual tape library, but would be grateful if someone else
tests this again on real hardware

 src/tape/pool_writer/mod.rs | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/src/tape/pool_writer/mod.rs b/src/tape/pool_writer/mod.rs
index cc069ff5..9ff4a173 100644
--- a/src/tape/pool_writer/mod.rs
+++ b/src/tape/pool_writer/mod.rs
@@ -150,21 +150,9 @@ impl PoolWriter {
 
     /// Export current media set and drop PoolWriterState (close drive)
     pub fn export_media_set(&mut self, worker: &WorkerTask) -> Result<(), Error> {
-        let mut status = self.status.take();
-
         let (drive_config, _digest) = pbs_config::drive::config()?;
 
         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
-            }
-            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();
@@ -175,7 +163,7 @@ impl PoolWriter {
                 }
             }
 
-        } else if let Some(mut status) = status {
+        } else if let Some(mut status) = self.status.take() {
             task_log!(worker, "standalone drive - ejecting media instead of export");
             status.drive.eject_media()?;
         }
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] [PATCH proxmox-backup 2/2] tape: improve export_media error message for not found tape
  2021-10-15  8:32 [pbs-devel] [PATCH proxmox-backup 1/2] tape: simplify export_media_set for pool writer Dominik Csapak
@ 2021-10-15  8:32 ` Dominik Csapak
  2021-10-18  8:41   ` [pbs-devel] applied: " Dietmar Maurer
  0 siblings, 1 reply; 3+ messages in thread
From: Dominik Csapak @ 2021-10-15  8:32 UTC (permalink / raw)
  To: pbs-devel

'export_media' can handle if the tape is in either a normal slot of the
library, or in the drive assigned to the current pool writer.
(because we need to lock the drive)

if it is, for some reason, in a different drive, the error message
 'media is not online'
could be slightly confusing for a user, since it would appear in the drive list

add the 'or a differen drive' to make it clearer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/tape/pool_writer/mod.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tape/pool_writer/mod.rs b/src/tape/pool_writer/mod.rs
index 9ff4a173..58995df3 100644
--- a/src/tape/pool_writer/mod.rs
+++ b/src/tape/pool_writer/mod.rs
@@ -159,7 +159,7 @@ impl PoolWriter {
                 if let Some(slot) = changer.export_media(label_text)? {
                     task_log!(worker, "exported media '{}' to import/export slot {}", label_text, slot);
                 } else {
-                    task_warn!(worker, "export failed - media '{}' is not online", label_text);
+                    task_warn!(worker, "export failed - media '{}' is not online or in different drive", label_text);
                 }
             }
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup 2/2] tape: improve export_media error message for not found tape
  2021-10-15  8:32 ` [pbs-devel] [PATCH proxmox-backup 2/2] tape: improve export_media error message for not found tape Dominik Csapak
@ 2021-10-18  8:41   ` Dietmar Maurer
  0 siblings, 0 replies; 3+ messages in thread
From: Dietmar Maurer @ 2021-10-18  8:41 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

applied




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-18  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15  8:32 [pbs-devel] [PATCH proxmox-backup 1/2] tape: simplify export_media_set for pool writer Dominik Csapak
2021-10-15  8:32 ` [pbs-devel] [PATCH proxmox-backup 2/2] tape: improve export_media error message for not found tape Dominik Csapak
2021-10-18  8:41   ` [pbs-devel] applied: " Dietmar Maurer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal