public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	 Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 1/2] tape: simplify export_media_set for pool writer
Date: Mon, 18 Oct 2021 10:38:40 +0200 (CEST)	[thread overview]
Message-ID: <1794375343.2692.1634546320626@webmail.proxmox.com> (raw)

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

But you drop much more functionality??

> 
> 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
> -            }

What about this rewind?

> -            drop(status); // close drive

and this drop()?

> -
> -            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
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel




             reply	other threads:[~2021-10-18  8:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  8:38 Dietmar Maurer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-15  8:32 Dominik Csapak

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=1794375343.2692.1634546320626@webmail.proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=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