]> git.proxmox.com Git - pve-storage.git/commit - PVE/Storage.pm
add generalized functions to manage volume attributes
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 30 Sep 2021 11:42:06 +0000 (13:42 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 8 Nov 2021 13:56:15 +0000 (14:56 +0100)
commitf1de828166a95d938828ea8539e6de666c9644bc
treeb818b5325291d9d86890134cc7d00713216de015
parente0aa2070f61c953f326f9205fd107f9d6ed12718
add generalized functions to manage volume attributes

replacing the ones for handling notes. To ensure backwards
compatibility with external plugins, all plugins that do not just call
another implementation need to call $class->{get, update}_volume_notes
when the attribute is 'notes' to catch any derived implementations.

This is mainly done to avoid the need to add new methods every time a
new attribute is added.

Not adding a timeout parameter like the notes functions have, because
it was not used and can still be added if it ever is needed in the
future.

For get_volume_attribute, undef will indicate that the attribute is
not supported. This makes it possible to distinguish "not supported"
from "error getting the attribute", which is useful when the attribute
is important for an operation. For example, free_image checking for
protection (introduced in a later patch) can abort if getting the
'protected' attribute fails.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/API2/Storage/Content.pm
PVE/Storage.pm
PVE/Storage/BTRFSPlugin.pm
PVE/Storage/CIFSPlugin.pm
PVE/Storage/CephFSPlugin.pm
PVE/Storage/DirPlugin.pm
PVE/Storage/NFSPlugin.pm
PVE/Storage/PBSPlugin.pm
PVE/Storage/Plugin.pm