Patch #12 is the 'real' change needed for the manager to get
'prune-backups' working. Patch #13 gets rid of 'maxfiles' internally,
re-using 'prune-backups' instead.
Most other new patches/changes are in preparation for those two,
to make it possible to translate maxfiles to keep-last and not have
too much special case handling for the '--dumpdir' case.

Changes from v2:
    * Introduce checks in archive_remove
    * Improve readability with ctimes in tests

archive_info has been extended even further to include an untainted filename
and for backups with standard names, the expected log filename.

A few tests for the prune logic are included.

Non-standard backups are ignored when pruning. I chose 'protected'
to mark those, 'ignore' could also be used. Backups are grouped
by type+ID.

The backup type from PBS is translated: ct->lxc, vm->qemu, so that the
possible values for the API result don't depend on the backend.

Regarding the API endpoints: there's a regex below '{storage}/content',
namely '{volume}', so it's not possible to create endpoints like
'{storage}/content/prunebackups'. Instead, I introduced 

A dependency bump 'manager -> storage' is needed for patches #11-#13.


Fabian Ebner (7):
  Introduce prune-backups property for directory-based storages
  Extend archive_info to include filename and logfilename
  Add archive_remove
  PBSPlugin: Add print_volid helper
  Add prune_backups to storage API
  Whitespace cleanup
  Add API and pvesm calls for prune_backups

 PVE/API2/Storage/Makefile        |   2 +-
 PVE/API2/Storage/ | 153 ++++++++++++++++++++
 PVE/API2/Storage/       |  72 +++++-----
 PVE/CLI/                 |  27 ++++
 PVE/                   | 133 ++++++++++++++++-
 PVE/Storage/        |   1 +
 PVE/Storage/      |   1 +
 PVE/Storage/         |   5 +-
 PVE/Storage/   |   5 +-
 PVE/Storage/         |   5 +-
 PVE/Storage/         |  64 ++++++++-
 PVE/Storage/            | 108 +++++++++++++-
 test/        |  22 +++
 test/       | 239 +++++++++++++++++++++++++++++++
 test/         |   1 +
 15 files changed, 786 insertions(+), 52 deletions(-)
 create mode 100644 PVE/API2/Storage/
 create mode 100644 test/


Fabian Ebner (6):
  Die if dumpdir and storage are both defined
  storage_info: avoid duplication
  Simplify how maxfiles is determined
  make use of archive_info and archive_remove
  Use prune-backups instead of maxfiles when configured
  Always use prune-backups instead of maxfiles internally

 PVE/ | 117 ++++++++++++++++++++++++++++++--------------------
 1 file changed, 70 insertions(+), 47 deletions(-)


pve-devel mailing list

Reply via email to