[pve-devel] [PATCH storage 2/2] plugins: allow limiting the number of protected backups per guest

Fabian Ebner f.ebner at proxmox.com
Thu Mar 17 09:03:58 CET 2022


Am 16.03.22 um 17:42 schrieb Thomas Lamprecht:
> On 16.12.21 13:12, Fabian Ebner wrote:
>> diff --git a/PVE/Storage.pm b/PVE/Storage.pm
>> index d64019f..0643fad 100755
>> --- a/PVE/Storage.pm
>> +++ b/PVE/Storage.pm
>> @@ -232,6 +232,30 @@ sub update_volume_attribute {
>>      my $scfg = storage_config($cfg, $storeid);
>>      my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
>>  
>> +    my ($vtype, undef, $vmid) = $plugin->parse_volname($volname);
>> +    my $max_protected_backups = $scfg->{'max-protected-backups'} // 5;
> 
> maybe the default limit should be user privilege dependent? E.g., for root and users
> with .Allocate on the storage it wouldn't be a problem to have unlimited (or a higher
> count) as default? I mean, it's naturally a bit odd to differ, but one can argue a lot
> with auto-magic-convenience ;P
> 

Would add another dimension to the complexity ;) Also feels a bit
awkward code-wise at a first glance, as we'd need to get the rpcenv/user
in such a sub (or pass the user or pre-computed default in somehow). But
if you really want to, I can give it a go for v2.





More information about the pve-devel mailing list