all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Stefan Reiter <s.reiter@proxmox.com>,
	Dietmar Maurer <dietmar@proxmox.com>
Subject: Re: [pbs-devel] [PATCH v3 proxmox-backup 2/2] client: implement map/unmap commands for .img backups
Date: Thu, 1 Oct 2020 17:36:39 +0200	[thread overview]
Message-ID: <de93b7ad-0b35-4134-250b-f56d5b4861e1@proxmox.com> (raw)
In-Reply-To: <20200825114625.26527-2-s.reiter@proxmox.com>

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.
> 
> The architecture uses a FUSE-backed temp file mapped to a loopdev:
> 
>   /dev/loopX -> FUSE /run/pbs-loopdev/xxx -> backup client -> PBS
> 
> 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.
> 
> 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.
> 
> A loopdev module is added to tools containing all required functions for
> mapping a loop device to the FUSE file, with the ioctls moved into an
> inline module to avoid exposing them directly.
> 
> The client code is placed in the 'mount' module, which, while
> admittedly a loose fit, allows reuse of the daemonizing code.
> 
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
> 
> v3:
> * better error messages in 'unmap'
> * rebase
> 
> I checked, and FUSE is not notified when the loop device disconnects... I'd say
> we just have the user handle that.
> 
> 
>  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
> 


What's the state of this? IIRC, Dietmar you wanted to give this a look?

Would be nice to have, IMO :-)





      reply	other threads:[~2020-10-01 15:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 11:46 [pbs-devel] [PATCH v3 proxmox-backup 1/2] client: mount: handle SIGTERM as well Stefan Reiter
2020-08-25 11:46 ` [pbs-devel] [PATCH v3 proxmox-backup 2/2] client: implement map/unmap commands for .img backups Stefan Reiter
2020-10-01 15:36   ` Thomas Lamprecht [this message]

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=de93b7ad-0b35-4134-250b-f56d5b4861e1@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=dietmar@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=s.reiter@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal