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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1B3827113C for ; Wed, 7 Apr 2021 12:23:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 04AE0F2E4 for ; Wed, 7 Apr 2021 12:23:11 +0200 (CEST) Received: from elsa.proxmox.com (unknown [94.136.29.99]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0F6A8F2DC for ; Wed, 7 Apr 2021 12:23:10 +0200 (CEST) Received: by elsa.proxmox.com (Postfix, from userid 0) id E8EFBAEAF1C; Wed, 7 Apr 2021 12:23:09 +0200 (CEST) From: Dietmar Maurer To: pbs-devel@lists.proxmox.com Date: Wed, 7 Apr 2021 12:22:57 +0200 Message-Id: <20210407102308.9750-1-dietmar@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox-tape.rs, mod.rs, pmtx.rs, sg-tape-cmd.rs, pmt.rs, changer.rs, drive.rs, sgutils2.rs] Subject: [pbs-devel] [PATCH 00/11] Userspace tape driver 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, 07 Apr 2021 10:23:41 -0000 This is a userspace drive implementation using SG_IO. Why we do not use the Linux tape driver anymore, because: - missing features (MAM, Encryption, ...) - strange permission handling - only root (or CAP_SYS_RAWIO) can do SG_IO (SYS_RAW_IO) - unability to detect EOT (you just get EIO) Dietmar Maurer (11): tape: introduce trait BlockRead tape: introduce trait BlockWrite tape: implement LTO userspace driver tape: implement format/erase tape: fix LEOM handling tape: make fsf/bsf driver specific tape: make sure there is a filemark at the end of the tape sgutils2: add scsi_mode_sense helper tape: correctly set/display drive option tape: pmt - re-implement fsr/bsr tape: pmt - re-implement lock/unlock command debian/proxmox-backup-server.udev | 18 + src/api2/config/changer.rs | 4 +- src/api2/config/drive.rs | 44 +- src/api2/tape/changer.rs | 4 +- src/api2/tape/drive.rs | 65 +-- src/api2/tape/mod.rs | 4 +- src/api2/types/tape/drive.rs | 34 +- src/bin/pmt.rs | 347 +++--------- src/bin/pmtx.rs | 4 +- src/bin/proxmox-tape.rs | 17 +- src/bin/proxmox_tape/drive.rs | 8 +- src/bin/sg-tape-cmd.rs | 189 +------ src/config/drive.rs | 18 +- src/tape/changer/mod.rs | 4 +- src/tape/drive/linux_tape.rs | 173 ++++-- src/tape/drive/lto/mod.rs | 474 ++++++++++++++++ src/tape/drive/lto/sg_tape.rs | 720 ++++++++++++++++++++++++ src/tape/drive/mod.rs | 53 +- src/tape/drive/virtual_tape.rs | 116 ++-- src/tape/file_formats/blocked_reader.rs | 70 ++- src/tape/file_formats/blocked_writer.rs | 37 +- src/tape/helpers/emulate_tape_reader.rs | 64 +-- src/tape/helpers/emulate_tape_writer.rs | 37 +- src/tape/linux_list_drives.rs | 51 +- src/tape/pool_writer/mod.rs | 2 +- src/tape/tape_read.rs | 35 +- src/tape/tape_write.rs | 61 +- src/tools/sgutils2.rs | 125 +++- www/Utils.js | 2 +- www/tape/DriveStatus.js | 8 +- www/tape/window/Erase.js | 4 +- 31 files changed, 1939 insertions(+), 853 deletions(-) create mode 100644 debian/proxmox-backup-server.udev create mode 100644 src/tape/drive/lto/mod.rs create mode 100644 src/tape/drive/lto/sg_tape.rs -- 2.20.1