[pve-devel] [PATCH manager] restore default value of 0 for remove/maxfiles

Stefan Reiter s.reiter at proxmox.com
Thu Nov 5 16:21:51 CET 2020


If neither the 'remove' option of vzdump nor the 'maxfiles' option in
the storage config are set, assume a value of 0, i.e. do not delete
anything and allow unlimited backups.

Restores previous behaviour that was broken in 7ab7d6f15f.

Also fixes a warning about using '== 0' on a non-number type.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 PVE/VZDump.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 6873ceaf..517becb1 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -474,7 +474,7 @@ sub new {
 
 	    if (!defined($opts->{'prune-backups'}) && !defined($opts->{maxfiles})) {
 		$opts->{'prune-backups'} = $info->{'prune-backups'};
-		$opts->{maxfiles} = $info->{maxfiles};
+		$opts->{maxfiles} = $info->{maxfiles} // 0;
 		if ($opts->{maxfiles} == 0) {
 		    # zero means keep all, so avoid triggering any remove code path to be safe
 		    $opts->{remove} = 0;
-- 
2.20.1






More information about the pve-devel mailing list