PVE/Storage/Plugin.pm: introduce on_update_hook

We need this to correctly update the password file.
This commit is contained in:
Dietmar Maurer
2020-02-20 12:33:58 +01:00
committed by Thomas Lamprecht
parent 9e34813f6c
commit 0ff4cfead1
2 changed files with 32 additions and 2 deletions

View File

@ -366,6 +366,15 @@ sub on_add_hook {
# do nothing by default
}
# called during storage configuration update (before the updated storage config got written)
# die to abort the update if there are (grave) problems
# NOTE: runs in a storage config *locked* context
sub on_update_hook {
my ($class, $storeid, $scfg, %param) = @_;
# do nothing by default
}
# called during deletion of storage (before the new storage config got written)
# and if the activate check on addition fails, to cleanup all storage traces
# which on_add_hook may have created.