all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage 1/2] avoid auto-vivication
@ 2020-11-23 14:54 Fabian Ebner
  2020-11-23 14:54 ` [pve-devel] [PATCH manager 2/2] cleanup keep-all handling Fabian Ebner
  2020-11-23 14:57 ` [pve-devel] applied: [PATCH storage 1/2] avoid auto-vivication Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Ebner @ 2020-11-23 14:54 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Follow-ups for my recent patches, as discussed off list.

 PVE/Storage.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 18357a8..bbbc66e 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -133,6 +133,8 @@ sub lock_storage_config {
 my $convert_maxfiles_to_prune_backups = sub {
     my ($scfg) = @_;
 
+    return if !$scfg;
+
     my $maxfiles = delete $scfg->{maxfiles};
 
     if (!defined($scfg->{'prune-backups'}) && defined($maxfiles)) {
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH manager 2/2] cleanup keep-all handling
  2020-11-23 14:54 [pve-devel] [PATCH storage 1/2] avoid auto-vivication Fabian Ebner
@ 2020-11-23 14:54 ` Fabian Ebner
  2020-11-23 14:57 ` [pve-devel] applied: [PATCH storage 1/2] avoid auto-vivication Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Fabian Ebner @ 2020-11-23 14:54 UTC (permalink / raw)
  To: pve-devel

If keep-all is set to 0, adding it doesn't make a difference,
if the key is not in the hash, it won't show up in the 'values'.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 PVE/VZDump.pm | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 178f37f5..c37fa513 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -737,10 +737,7 @@ sub exec_backup_task {
 	my $prune_options = $opts->{'prune-backups'};
 
 	my $backup_limit = 0;
-	my $keep_all = delete $prune_options->{'keep-all'};
-	if ($keep_all) {
-	    $prune_options = { 'keep-all' => 1 };
-	} else {
+	if (!$prune_options->{'keep-all'}) {
 	    foreach my $keep (values %{$prune_options}) {
 		$backup_limit += $keep;
 	    }
-- 
2.20.1





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied:  [PATCH storage 1/2] avoid auto-vivication
  2020-11-23 14:54 [pve-devel] [PATCH storage 1/2] avoid auto-vivication Fabian Ebner
  2020-11-23 14:54 ` [pve-devel] [PATCH manager 2/2] cleanup keep-all handling Fabian Ebner
@ 2020-11-23 14:57 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2020-11-23 14:57 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Ebner

On 23.11.20 15:54, Fabian Ebner wrote:
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> 
> Follow-ups for my recent patches, as discussed off list.
> 
>  PVE/Storage.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-23 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 14:54 [pve-devel] [PATCH storage 1/2] avoid auto-vivication Fabian Ebner
2020-11-23 14:54 ` [pve-devel] [PATCH manager 2/2] cleanup keep-all handling Fabian Ebner
2020-11-23 14:57 ` [pve-devel] applied: [PATCH storage 1/2] avoid auto-vivication Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal