all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH storage 0/3] generalize volname_for_format across storage plugins
@ 2026-08-12 15:32 Elias Huhsovitz
  2026-08-12 15:32 ` [PATCH storage 1/3] plugin: refactor format parsing in parse_volname and parse_name_dir Elias Huhsovitz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Elias Huhsovitz @ 2026-08-12 15:32 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

Previously, only the LVM plugin explicitly validated that a requested
volume format matched the provided volume name. This inconsistency
allowed other storage backends to silently accept mismatched names and
formats, leading to confusing states (as was previously mentioned in
bug #7811).

Centralize volname_for_format() in the base PVE::Storage::Plugin. 
This design allows individual plugins to override specific parsing
behavior while sharing the core validation logic.

The new validation method operates in two modes:

* Lax mode (default): Names without an extension are
  automatically adapted to the requested format. Names that
  explicitly spell out a contradicting format are rejected.

* Strict mode: Any format mismatch results in an error.

To preserve backwards compatibility, only the default lax
mode is currently used in alloc_image() and rename_volume().
Should strict volume name guidelines be needed in the
future, the strict parameter can be enabled at the call
sites.

Potential Pitfalls
------------------
Because this introduces stricter validation checks, there is a chance
it may break existing systems, scripts, or automation that previously
relied on passing mismatched volume names and formats without
triggering an error.

Patch Overview
--------------

Elias Huhsovitz (3):
  plugin: refactor format parsing in parse_volname and parse_name_dir
  plugin: generalize volname_for_format across storage plugins
  test: plugin: add unit tests for volname_for_format

 src/PVE/Storage/BTRFSPlugin.pm      |   6 +-
 src/PVE/Storage/LVMPlugin.pm        |  39 +-
 src/PVE/Storage/LvmThinPlugin.pm    |  18 +-
 src/PVE/Storage/Plugin.pm           |  99 +++-
 src/PVE/Storage/RBDPlugin.pm        |  22 +-
 src/PVE/Storage/ZFSPlugin.pm        |   2 +
 src/PVE/Storage/ZFSPoolPlugin.pm    |  37 ++
 src/test/run_plugin_tests.pl        |   1 +
 src/test/volname_for_format_test.pm | 813 ++++++++++++++++++++++++++++
 9 files changed, 1005 insertions(+), 32 deletions(-)
 create mode 100644 src/test/volname_for_format_test.pm

-- 
2.47.3





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

end of thread, other threads:[~2026-08-12 15:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12 15:32 [PATCH storage 0/3] generalize volname_for_format across storage plugins Elias Huhsovitz
2026-08-12 15:32 ` [PATCH storage 1/3] plugin: refactor format parsing in parse_volname and parse_name_dir Elias Huhsovitz
2026-08-12 15:32 ` [PATCH storage 2/3] plugin: generalize volname_for_format across storage plugins Elias Huhsovitz
2026-08-12 15:32 ` [PATCH storage 3/3] test: plugin: add unit tests for volname_for_format Elias Huhsovitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal