From 1ab98f059e1d28e5dd28f326ab371d6d5c1b8bb4 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 3 Mar 2016 15:49:59 +0100 Subject: [PATCH] vzdump: fix default values Not all document default values matched their actual default, fix this by not maintaining two separate lists of default values. Note that this changes: - the default compression from none to the documented LZO - the documented default mode from stop to snapshot --- PVE/VZDump.pm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm index a3d1f2c3..4afe2afb 100644 --- a/PVE/VZDump.pm +++ b/PVE/VZDump.pm @@ -77,7 +77,7 @@ my $confdesc = { type => 'string', description => "Backup mode.", optional => 1, - default => 'stop', + default => 'snapshot', enum => [ 'snapshot', 'suspend', 'stop' ], }, exclude => { @@ -133,12 +133,14 @@ my $confdesc = { description => "LVM snapshot size in MB.", optional => 1, minimum => 500, + default => 1024, }, bwlimit => { type => 'integer', description => "Limit I/O bandwidth (KBytes per second).", optional => 1, minimum => 0, + default => 0, }, ionice => { type => 'integer', @@ -146,24 +148,28 @@ my $confdesc = { optional => 1, minimum => 0, maximum => 8, + default => 7, }, lockwait => { type => 'integer', description => "Maximal time to wait for the global lock (minutes).", optional => 1, minimum => 0, + default => 3*60, # 3 hours }, stopwait => { type => 'integer', description => "Maximal time to wait until a VM is stopped (minutes).", optional => 1, minimum => 0, + default => 10, # 10 minutes }, maxfiles => { type => 'integer', description => "Maximal number of backup files per VM.", optional => 1, minimum => 1, + default => 1, }, remove => { type => 'boolean', @@ -328,14 +334,10 @@ sub read_vzdump_defaults { my $fn = "/etc/vzdump.conf"; my $defaults = { - bwlimit => 0, - ionice => 7, - size => 1024, - lockwait => 3*60, # 3 hours - stopwait => 10, # 10 minutes - mode => 'snapshot', - maxfiles => 1, - pigz => 0, + map { + my $default = $confdesc->{$_}->{default}; + defined($default) ? ($_ => $default) : () + } keys %$confdesc }; my $raw;