config: drop 'maxfiles' parameter

The 'maxfiles' parameter has been deprecated since the addition of
'prune-backups' in the Proxmox VE 7 beta.

The setting was auto-converted when reading the storage
configuration.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250718125408.133376-2-f.ebner@proxmox.com
This commit is contained in:
Fiona Ebner
2025-07-18 14:51:12 +02:00
committed by Thomas Lamprecht
parent fc633887dc
commit e502404fa2
10 changed files with 0 additions and 38 deletions

View File

@ -249,27 +249,6 @@ sub lock_storage_config {
} }
} }
# FIXME remove maxfiles for PVE 8.0 or PVE 9.0
my $convert_maxfiles_to_prune_backups = sub {
my ($scfg) = @_;
return if !$scfg;
my $maxfiles = delete $scfg->{maxfiles};
if (!defined($scfg->{'prune-backups'}) && defined($maxfiles)) {
my $prune_backups;
if ($maxfiles) {
$prune_backups = { 'keep-last' => $maxfiles };
} else { # maxfiles 0 means no limit
$prune_backups = { 'keep-all' => 1 };
}
$scfg->{'prune-backups'} = PVE::JSONSchema::print_property_string(
$prune_backups, 'prune-backups',
);
}
};
sub storage_config { sub storage_config {
my ($cfg, $storeid, $noerr) = @_; my ($cfg, $storeid, $noerr) = @_;
@ -279,8 +258,6 @@ sub storage_config {
die "storage '$storeid' does not exist\n" if (!$noerr && !$scfg); die "storage '$storeid' does not exist\n" if (!$noerr && !$scfg);
$convert_maxfiles_to_prune_backups->($scfg);
return $scfg; return $scfg;
} }

View File

@ -68,7 +68,6 @@ sub options {
nodes => { optional => 1 }, nodes => { optional => 1 },
shared => { optional => 1 }, shared => { optional => 1 },
disable => { optional => 1 }, disable => { optional => 1 },
maxfiles => { optional => 1 },
'prune-backups' => { optional => 1 }, 'prune-backups' => { optional => 1 },
'max-protected-backups' => { optional => 1 }, 'max-protected-backups' => { optional => 1 },
content => { optional => 1 }, content => { optional => 1 },

View File

@ -153,7 +153,6 @@ sub options {
subdir => { optional => 1 }, subdir => { optional => 1 },
nodes => { optional => 1 }, nodes => { optional => 1 },
disable => { optional => 1 }, disable => { optional => 1 },
maxfiles => { optional => 1 },
'prune-backups' => { optional => 1 }, 'prune-backups' => { optional => 1 },
'max-protected-backups' => { optional => 1 }, 'max-protected-backups' => { optional => 1 },
content => { optional => 1 }, content => { optional => 1 },

View File

@ -153,7 +153,6 @@ sub options {
'create-subdirs' => { optional => 1 }, 'create-subdirs' => { optional => 1 },
fuse => { optional => 1 }, fuse => { optional => 1 },
bwlimit => { optional => 1 }, bwlimit => { optional => 1 },
maxfiles => { optional => 1 },
keyring => { optional => 1 }, keyring => { optional => 1 },
'prune-backups' => { optional => 1 }, 'prune-backups' => { optional => 1 },
'max-protected-backups' => { optional => 1 }, 'max-protected-backups' => { optional => 1 },

View File

@ -84,7 +84,6 @@ sub options {
nodes => { optional => 1 }, nodes => { optional => 1 },
shared => { optional => 1 }, shared => { optional => 1 },
disable => { optional => 1 }, disable => { optional => 1 },
maxfiles => { optional => 1 },
'prune-backups' => { optional => 1 }, 'prune-backups' => { optional => 1 },
'max-protected-backups' => { optional => 1 }, 'max-protected-backups' => { optional => 1 },
content => { optional => 1 }, content => { optional => 1 },

View File

@ -93,7 +93,6 @@ sub options {
export => { fixed => 1 }, export => { fixed => 1 },
nodes => { optional => 1 }, nodes => { optional => 1 },
disable => { optional => 1 }, disable => { optional => 1 },
maxfiles => { optional => 1 },
'prune-backups' => { optional => 1 }, 'prune-backups' => { optional => 1 },
'max-protected-backups' => { optional => 1 }, 'max-protected-backups' => { optional => 1 },
options => { optional => 1 }, options => { optional => 1 },

View File

@ -73,7 +73,6 @@ sub options {
password => { optional => 1 }, password => { optional => 1 },
'encryption-key' => { optional => 1 }, 'encryption-key' => { optional => 1 },
'master-pubkey' => { optional => 1 }, 'master-pubkey' => { optional => 1 },
maxfiles => { optional => 1 },
'prune-backups' => { optional => 1 }, 'prune-backups' => { optional => 1 },
'max-protected-backups' => { optional => 1 }, 'max-protected-backups' => { optional => 1 },
fingerprint => { optional => 1 }, fingerprint => { optional => 1 },

View File

@ -159,13 +159,6 @@ my $defaultData = {
type => 'boolean', type => 'boolean',
optional => 1, optional => 1,
}, },
maxfiles => {
description => "Deprecated: use 'prune-backups' instead. "
. "Maximal number of backup files per VM. Use '0' for unlimited.",
type => 'integer',
minimum => 0,
optional => 1,
},
'prune-backups' => get_standard_option('prune-backups'), 'prune-backups' => get_standard_option('prune-backups'),
'max-protected-backups' => { 'max-protected-backups' => {
description => description =>

View File

@ -63,7 +63,6 @@ my $mocked_vmlist = {
my $storage_dir = File::Temp->newdir(); my $storage_dir = File::Temp->newdir();
my $scfg = { my $scfg = {
'type' => 'dir', 'type' => 'dir',
'maxfiles' => 0,
'path' => $storage_dir, 'path' => $storage_dir,
'shared' => 0, 'shared' => 0,
'content' => { 'content' => {

View File

@ -22,7 +22,6 @@ my $scfg = {
'shared' => 0, 'shared' => 0,
'path' => "$storage_dir", 'path' => "$storage_dir",
'type' => 'dir', 'type' => 'dir',
'maxfiles' => 0,
'content' => { 'content' => {
'snippets' => 1, 'snippets' => 1,
'rootdir' => 1, 'rootdir' => 1,