From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 01650762CA for ; Mon, 18 Oct 2021 10:40:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EBC2A1EC75 for ; Mon, 18 Oct 2021 10:40:13 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 22B251EC65 for ; Mon, 18 Oct 2021 10:40:13 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E87254687F for ; Mon, 18 Oct 2021 10:40:12 +0200 (CEST) Date: Mon, 18 Oct 2021 10:38:40 +0200 (CEST) From: Dietmar Maurer To: Proxmox Backup Server development discussion , Dominik Csapak Message-ID: <1794375343.2692.1634546320626@webmail.proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.5-Rev25 X-Originating-Client: open-xchange-appsuite X-SPAM-LEVEL: Spam detection results: 0 AWL 0.534 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup 1/2] tape: simplify export_media_set for pool writer X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2021 08:40:14 -0000 > 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 > --- > 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