public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH v7 vma-to-pbs 0/9] Implement vma-to-pbs tool
@ 2024-04-09 12:14 Filip Schauer
  2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 1/9] add the ability to provide credentials via files Filip Schauer
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Filip Schauer @ 2024-04-09 12:14 UTC (permalink / raw)
  To: pbs-devel

Implement a tool to import VMA files into a Proxmox Backup Server

Example usage:

zstd -d --stdout vzdump.vma.zst | vma-to-pbs \
    --repository <auth_id@host:port:datastore> \
    --vmid 123 \
    --password-file pbs_password

Changes since v6:
* Move bail! in VmaReader::restore to the commit it was introduced in
* Move the use of anyhow::Context for fingerprint argument matching to
  the commit it was introduced in
* Use proxmox_time::epoch_to_rfc3339 for formatting backup_time
* Refactor elapsed time calculation for better readability
* Bump proxmox-backup-qemu in order to get access to ProxmoxBackupHandle
* use anyhow::format_err
* Move introduction of handle_pbs_error to the commit that introduced
  vma2pbs.
* Use anyhow::Error with std::result::Result instead of anyhow::Result

Changes since v5:
* Switch argument parsing from clap to pico-args
* Change time printing format ISO 8601 timestamps
* use anyhow::bail, so it does not have to be written out everytime
* Force the usage of password files when passing the vma file to stdin
* Cut off a trailing new line when reading a password from a file
* Extract PBS error handling into a seperate function
* Reformat command line arguments to kebab-case
* Refactor VmaReader to be generic over Read trait
* Split up block device upload into smaller functions to improve readability

Changes since v4:
* Bump proxmox-backup-qemu
* Remove unnecessary "extern crate" declarations
* Refactor error handling with anyhow
* vma.rs: Improve code readability by adding constants and using more
  descriptive variable/type names.
* vma.rs: Move duplicate code into read_string function
* Print elapsed time in minutes, seconds and ms
* Refactor block device id and size retrieval logic
* vma: Document break statement when reaching end of file
* Use selected imports instead of glob imports
* Split up vma2pbs logic into seperate functions
* Makefile: remove reference to unused submodule

Changes since v3:
* Add the ability to provide credentials via files
* Add support for streaming the VMA file via stdin
* Add a fallback for the --fingerprint argument

Changes since v2:
* Use the deb packages from the proxmox-io and proxmox-sys dependencies
  instead of the proxmox submodule
* Remove the proxmox submodule
* Update the proxmox-backup-qemu submodule to make it buildable with
  the newest librust dependencies

Changes since v1:
* Remove unused crates and uses
* Format the code
* Use anyhow for error handling
* Use clap for parsing arguments instead of getopts
* Fix blocks being reindexed on every read
* Make sure ProxmoxBackupHandle is dropped properly on error
* Move image_chunk_buffer from stack to heap
* Move the block_index in VmaReader to the heap completely
* Initialize vectors with `Vec::with_capacity` and `resize` instead of
  the `vec!` macro, to potentially improve performance on debug builds.
* Add comments to code filling the MD5 sum field with zeros
* Change device_id arguments to usize
* Handle devices that have a size that is not aligned to 4096 properly
  in read_device_contents, when the caller provides a buffer that would
  exceed the device size.
* Avoid unnecessary loop iterations in read_device_contents when the
  buffer size is not aligned to 65536

Filip Schauer (9):
  add the ability to provide credentials via files
  bump proxmox-backup-qemu
  remove unnecessary "extern crate" declarations
  add support for streaming the VMA file via stdin
  add a fallback for the --fingerprint argument
  refactor error handling
  makefile: remove reference to unused submodule
  switch argument handling from clap to pico-args
  reformat command line arguments to kebab-case

 Cargo.toml                     |   3 +-
 Makefile                       |   2 +-
 src/main.rs                    | 421 +++++++++++----------------------
 src/vma.rs                     | 341 ++++++++++++--------------
 src/vma2pbs.rs                 | 376 +++++++++++++++++++++++++++++
 submodules/proxmox-backup-qemu |   2 +-
 6 files changed, 675 insertions(+), 470 deletions(-)
 create mode 100644 src/vma2pbs.rs

-- 
2.39.2





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-04-09 13:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-09 12:14 [pbs-devel] [PATCH v7 vma-to-pbs 0/9] Implement vma-to-pbs tool Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 1/9] add the ability to provide credentials via files Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 2/9] bump proxmox-backup-qemu Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 3/9] remove unnecessary "extern crate" declarations Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 4/9] add support for streaming the VMA file via stdin Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 5/9] add a fallback for the --fingerprint argument Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 6/9] refactor error handling Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 7/9] makefile: remove reference to unused submodule Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 8/9] switch argument handling from clap to pico-args Filip Schauer
2024-04-09 12:14 ` [pbs-devel] [PATCH v7 vma-to-pbs 9/9] reformat command line arguments to kebab-case Filip Schauer
2024-04-09 13:00 ` [pbs-devel] applied-series: [PATCH v7 vma-to-pbs 0/9] Implement vma-to-pbs tool Wolfgang Bumiller
2024-04-09 13:20 ` [pbs-devel] " Max Carrara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal