[pbs-devel] [RFC proxmox-backup v2 0/4] more flexible HumanByte type

Dietmar Maurer dietmar at proxmox.com
Wed Nov 17 14:37:16 CET 2021


Changes since v1:

- do not expose auto_unit functions
- store size as u64 (suggested by thomas)
- do not store unit (suggested by thomas)

The disadvantage is that the config value does not exactly
match the value you set, for example:

 proxmox-backup-manager traffic-control update rule0 --rate-out 1.2mib

config contains "1.198 MiB"

 proxmox-backup-manager traffic-control update rule0 --rate-out 1200kib

config contains "1.17 MiB"


Dietmar Maurer (4):
  pbs-api-types: more flexible HumanByte type
  use HumanByte for traffic-control config
  HumanByte: use u64 instead of f64 to store size
  HumanByte: do not store unit (always compute canonical form)

 pbs-api-types/src/human_byte.rs      | 326 +++++++++++++++++++++++++++
 pbs-api-types/src/lib.rs             |   3 +
 pbs-api-types/src/traffic_control.rs |  18 +-
 pbs-client/src/backup_writer.rs      |  19 +-
 pbs-datastore/src/datastore.rs       |  13 +-
 pbs-tools/Cargo.toml                 |   1 +
 pbs-tools/src/format.rs              |  55 +----
 src/bin/proxmox-tape.rs              |   7 +-
 src/cached_traffic_control.rs        |  18 +-
 src/server/email_notifications.rs    |   5 +-
 10 files changed, 376 insertions(+), 89 deletions(-)
 create mode 100644 pbs-api-types/src/human_byte.rs

-- 
2.30.2






More information about the pbs-devel mailing list