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 9218462ECD for ; Thu, 1 Oct 2020 17:36:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 868A122FE0 for ; Thu, 1 Oct 2020 17:36:41 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 4C16722FD4 for ; Thu, 1 Oct 2020 17:36:40 +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 0675145BA7 for ; Thu, 1 Oct 2020 17:36:40 +0200 (CEST) To: Proxmox Backup Server development discussion , Stefan Reiter , Dietmar Maurer References: <20200825114625.26527-1-s.reiter@proxmox.com> <20200825114625.26527-2-s.reiter@proxmox.com> From: Thomas Lamprecht Message-ID: Date: Thu, 1 Oct 2020 17:36:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Thunderbird/82.0 MIME-Version: 1.0 In-Reply-To: <20200825114625.26527-2-s.reiter@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.157 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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. [tools.rs, proxmox-backup-client.rs, mount.rs, loopdev.rs] Subject: Re: [pbs-devel] [PATCH v3 proxmox-backup 2/2] client: implement map/unmap commands for .img backups 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: Thu, 01 Oct 2020 15:36:41 -0000 On 25.08.20 13:46, Stefan Reiter wrote: > Allows mapping fixed-index .img files (usually from VM backups) to be > mapped to a local loopback device. >=20 > The architecture uses a FUSE-backed temp file mapped to a loopdev: >=20 > /dev/loopX -> FUSE /run/pbs-loopdev/xxx -> backup client -> PBS >=20 > Since unmapping requires some cleanup (unmap the loopdev, stop FUSE, > remove the temp files) a special 'unmap' command is added, which uses a= > PID file to send SIGINT to the backup-client instance started with > 'map', which will handle the cleanup itself. >=20 > The polling with select! in mount.rs needs to be split in two, since we= > have a chicken and egg problem between running FUSE and setting up the > loop device - so we need to do them concurrently, until the loopdev is > assigned, at which point we can report success and daemonize, and then > continue polling the FUSE loop future. >=20 > A loopdev module is added to tools containing all required functions fo= r > mapping a loop device to the FUSE file, with the ioctls moved into an > inline module to avoid exposing them directly. >=20 > The client code is placed in the 'mount' module, which, while > admittedly a loose fit, allows reuse of the daemonizing code. >=20 > Signed-off-by: Stefan Reiter > --- >=20 > v3: > * better error messages in 'unmap' > * rebase >=20 > I checked, and FUSE is not notified when the loop device disconnects...= I'd say > we just have the user handle that. >=20 >=20 > src/bin/proxmox-backup-client.rs | 2 + > src/bin/proxmox_backup_client/mount.rs | 182 ++++++++++++++--- > src/tools.rs | 2 + > src/tools/fuse_loop.rs | 258 +++++++++++++++++++++++++= > src/tools/loopdev.rs | 93 +++++++++ > 5 files changed, 509 insertions(+), 28 deletions(-) > create mode 100644 src/tools/fuse_loop.rs > create mode 100644 src/tools/loopdev.rs >=20 What's the state of this? IIRC, Dietmar you wanted to give this a look? Would be nice to have, IMO :-)