public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] restore default value of 0 for remove/maxfiles
Date: Thu,  5 Nov 2020 16:21:51 +0100	[thread overview]
Message-ID: <20201105152151.16344-1-s.reiter@proxmox.com> (raw)

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@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





             reply	other threads:[~2020-11-05 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 15:21 Stefan Reiter [this message]
2020-11-06  8:44 ` Fabian Ebner
2020-11-06  8:46 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201105152151.16344-1-s.reiter@proxmox.com \
    --to=s.reiter@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal