public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2] tape: simplify export_media_set for pool writer
Date: Mon, 18 Oct 2021 11:24:12 +0200	[thread overview]
Message-ID: <20211018092412.2352235-1-d.csapak@proxmox.com> (raw)

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>
---
changes from v1:
* do not drop the rewind first, so that the unload does not timeout. also fix
  comment and log for that
 src/tape/pool_writer/mod.rs | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/tape/pool_writer/mod.rs b/src/tape/pool_writer/mod.rs
index 3f9232d8..5d8d1644 100644
--- a/src/tape/pool_writer/mod.rs
+++ b/src/tape/pool_writer/mod.rs
@@ -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();
-- 
2.30.2





             reply	other threads:[~2021-10-18  9:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  9:24 Dominik Csapak [this message]
2021-10-21  4:38 ` [pbs-devel] applied: " Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211018092412.2352235-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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