45f9b32e0f
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> |
||
---|---|---|
.cargo | ||
debian | ||
docs | ||
etc | ||
examples | ||
src | ||
tests | ||
www | ||
zsh-completions | ||
.gitignore | ||
Cargo.toml | ||
defines.mk | ||
Makefile | ||
README.rst | ||
rustfmt.toml | ||
TODO.rst |
``rustup`` Toolchain ==================== We normally want to build with the ``rustc`` Debian package. To do that you can set the following ``rustup`` configuration: # rustup toolchain link system /usr # rustup default system Versioning of proxmox helper crates =================================== To use current git master code of the proxmox* helper crates, add:: git = "ssh://gitolite3@proxdev.maurer-it.com/rust/proxmox" or:: path = "../proxmox/proxmox" to the proxmox dependency, and update the version to reflect the current, pre-release version number (e.g., "0.1.1-dev.1" instead of "0.1.0"). Local cargo config ================== This repository ships with a ``.cargo/config`` that replaces the crates.io registry with packaged crates located in ``/usr/share/cargo/registry``. A similar config is also applied building with dh_cargo. Cargo.lock needs to be deleted when switching between packaged crates and crates.io, since the checksums are not compatible. To reference new dependencies (or updated versions) that are not yet packaged, the dependency needs to point directly to a path or git source (e.g., see example for proxmox crate above).