proxmox-backup/src/tools
Stefan Reiter 45f9b32e0f client: implement map/unmap commands for .img backups
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>
2020-10-06 09:08:14 +02:00
..
disks various typo fixes 2020-08-25 18:52:31 +02:00
systemd avoid chrono dependency, depend on proxmox 0.3.8 2020-09-15 07:12:57 +02:00
acl.rs pxar, acl: cleanup acl helper usage 2020-06-12 10:52:18 +02:00
async_io.rs update a chunk of stuff to the hyper release 2019-12-13 11:24:41 +01:00
borrow.rs tools: borrow: implement Deref for Tied 2019-02-13 11:03:09 +01:00
broadcast_future.rs typo fixes all over the place 2020-05-30 16:39:08 +02:00
cert.rs refactor CertInfo to tools 2020-07-10 11:08:53 +02:00
daemon.rs src/tools/daemon.rs: reopen STDOUT/STDERR journald streams to get correct PID in logs 2020-06-22 13:06:53 +02:00
disks.rs various typo fixes 2020-08-25 18:52:31 +02:00
file_logger.rs avoid chrono dependency, depend on proxmox 0.3.8 2020-09-15 07:12:57 +02:00
format.rs avoid chrono dependency, depend on proxmox 0.3.8 2020-09-15 07:12:57 +02:00
fs.rs src/tools/fs.rs: new helper lock_dir_noblock 2020-08-11 10:57:48 +02:00
fuse_loop.rs client: implement map/unmap commands for .img backups 2020-10-06 09:08:14 +02:00
logrotate.rs tools: add logrotate module 2020-09-29 08:33:21 +02:00
loopdev.rs client: implement map/unmap commands for .img backups 2020-10-06 09:08:14 +02:00
lru_cache.rs lru_cache: restrict and annotate Send impl 2020-06-19 09:37:34 +02:00
nom.rs fix typo 2020-06-26 09:12:29 +02:00
parallel_handler.rs src/tools/parallel_handler.rs: remove lifetime hacks, require 'static 2020-10-01 14:52:48 +02:00
process_locker.rs typo fixes all over the place 2020-05-30 16:39:08 +02:00
runtime.rs src/tools/runtime.rs: implement get_runtime_with_builder 2020-07-07 10:11:04 +02:00
statistics.rs statistics: covariance(): avoid allocation 2020-06-09 13:57:27 +02:00
std_channel_writer.rs switch from failure to anyhow 2020-04-17 18:43:30 +02:00
systemd.rs avoid chrono dependency, depend on proxmox 0.3.8 2020-09-15 07:12:57 +02:00
ticket.rs avoid chrono dependency, depend on proxmox 0.3.8 2020-09-15 07:12:57 +02:00
wrapped_reader_stream.rs add AsyncReaderStream 2020-06-23 06:33:31 +02:00
xattr.rs tools/xattr: a char from C is not universally a rust i8 2020-07-19 19:46:27 +02:00