[pve-devel] [PATCH manager 1/2] VZDump: mark 'size' as deprecated, warn if set

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Apr 14 10:34:42 CEST 2016


this parameter should be removed in a future release, just
warn and change description for now to avoid breakage.
---
 PVE/API2/VZDump.pm | 2 +-
 PVE/VZDump.pm      | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/VZDump.pm b/PVE/API2/VZDump.pm
index 64a1139..712c712 100644
--- a/PVE/API2/VZDump.pm
+++ b/PVE/API2/VZDump.pm
@@ -112,7 +112,7 @@ __PACKAGE__->register_method ({
 	die "you can only backup a single VM with option --stdout\n"
 	    if $param->{stdout} && scalar(@vmids) != 1;
 
-	foreach my $key (qw(maxfiles tmpdir dumpdir script size bwlimit ionice)) {
+	foreach my $key (qw(maxfiles tmpdir dumpdir script bwlimit ionice)) {
 	    raise_param_exc({ $key => "Only root may set this option."})
 		if defined($param->{$key}) && ($user ne 'root at pam');	    
 	}
diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 9836726..d002fe7 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -130,7 +130,7 @@ my $confdesc = {
     },
     size => {
 	type => 'integer',
-	description => "LVM snapshot size in MB.",
+	description => "Unused, will be removed in a future release.",
 	optional => 1,
 	minimum => 500,
 	default => 1024,
@@ -1194,6 +1194,10 @@ sub verify_vzdump_parameters {
 
     $param->{all} = 1 if defined($param->{exclude});
 
+    warn "option 'size' is deprecated and will be removed in a future " .
+	 "release, please update your script/configuration!\n"
+	if defined($param->{size});
+
     return if !$check_missing;
 
     raise_param_exc({ vmid => "property is missing"})
-- 
2.1.4





More information about the pve-devel mailing list