[pve-devel] applied: [PATCH storage 0/5] adding hooks for storage addition and deletion
Wolfgang Bumiller
w.bumiller at proxmox.com
Tue Jul 3 12:31:11 CEST 2018
applied
On Mon, Jul 02, 2018 at 03:54:43PM +0200, Thomas Lamprecht wrote:
> Motivated by the storage specific code in the Config API module used to set
> things up when adding a storage, and cleaning up when deleting one this
> series came to life.
>
> Add two hooks, on_add_hook and on_delete_hook, which are called in the
> create (i.e., add) storage config and delete storage config calls.
> They run in locked context but before the updated storage configuration was
> actually written out.
>
> This allows to move the storage specific code to it's plugin, which improves
> encapsulation and simplifies error handling a bit. External Plugins can also
> profit from this change.
Makes sense. Another if/else chain in the storage code factored into the
plugins.
> While this may even be applied as is, the interface could still be
> discussed.
>
> Thomas Lamprecht (5):
> add on_add and on_delete hooks
> cifs: use add/delete hooks
> rbd: use add/delete hooks
> lvm: use add hook
> api add: remove now uneeded $cred_file variable
>
> PVE/API2/Storage/Config.pm | 57 ++++----------------------------------
> PVE/Storage/CIFSPlugin.pm | 17 ++++++++++++
> PVE/Storage/LVMPlugin.pm | 22 +++++++++++++++
> PVE/Storage/Plugin.pm | 20 +++++++++++++
> PVE/Storage/RBDPlugin.pm | 34 +++++++++++++++++++++++
> 5 files changed, 99 insertions(+), 51 deletions(-)
>
> --
> 2.17.1
More information about the pve-devel
mailing list