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 AC909B3A6 for ; Wed, 9 Aug 2023 11:13:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 852C4127E7 for ; Wed, 9 Aug 2023 11:12:57 +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 for ; Wed, 9 Aug 2023 11:12:56 +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 8BFE143BC5 for ; Wed, 9 Aug 2023 11:12:56 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Wed, 9 Aug 2023 11:12:55 +0200 Message-Id: <20230809091255.2111507-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.011 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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: [pbs-devel] [PATCH proxmox-backup] tape: library status: don't fail if the library does not support DVCID 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: Wed, 09 Aug 2023 09:13:27 -0000 some libraries (e.g. Qualstar) don't support the DVCID bit in the READ ELEMENT (B8) command (to return vendor/model of connected drives), so make that part optional if it fails. We only ever use the serial number in the `pmtx` tool, so there is not much downside to not having this. This increases compatibility with such libraries Reported in the forum: https://forum.proxmox.com/threads/cant-query-tape-robot-status.131833/ Signed-off-by: Dominik Csapak --- pbs-tape/src/sg_pt_changer.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pbs-tape/src/sg_pt_changer.rs b/pbs-tape/src/sg_pt_changer.rs index c5a0b561..6cb3a044 100644 --- a/pbs-tape/src/sg_pt_changer.rs +++ b/pbs-tape/src/sg_pt_changer.rs @@ -398,20 +398,22 @@ pub fn read_element_status(file: &mut F) -> Result // get the serial + vendor + model, // some changer require this to be an extra scsi command - let page = get_element( + // some changers don't support this + if let Ok(page) = get_element( &mut sg_raw, ElementType::DataTransferWithDVCID, allocation_len, false, - )?; - // should be in same order and same count, but be on the safe side. - // there should not be too many drives normally - for drive in drives.iter_mut() { - for drive2 in &page.drives { - if drive2.element_address == drive.element_address { - drive.vendor = drive2.vendor.clone(); - drive.model = drive2.model.clone(); - drive.drive_serial_number = drive2.drive_serial_number.clone(); + ) { + // should be in same order and same count, but be on the safe side. + // there should not be too many drives normally + for drive in drives.iter_mut() { + for drive2 in &page.drives { + if drive2.element_address == drive.element_address { + drive.vendor = drive2.vendor.clone(); + drive.model = drive2.model.clone(); + drive.drive_serial_number = drive2.drive_serial_number.clone(); + } } } } -- 2.30.2