allow to set option 'maxfiles'

This commit is contained in:
Dietmar Maurer
2012-03-21 07:17:11 +01:00
parent 6bf7eb0903
commit 446073f681
4 changed files with 27 additions and 4 deletions

View File

@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
PACKAGE=libpve-storage-perl
PKGREL=14
PKGREL=15
DESTDIR=
PREFIX=/usr

View File

@ -168,6 +168,11 @@ __PACKAGE__->register_method ({
type => 'boolean',
optional => 1,
},
maxfiles => {
type => 'integer',
optional => 1,
minimum => 0,
},
shared => {
type => 'boolean',
optional => 1,
@ -270,6 +275,11 @@ __PACKAGE__->register_method ({
type => 'string', format => 'pve-storage-options',
optional => 1,
},
maxfiles => {
type => 'integer',
optional => 1,
minimum => 0,
},
digest => {
type => 'string',
description => 'Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.',

View File

@ -149,6 +149,7 @@ my $confvars = {
target => 'target',
nodes => 'nodes',
options => 'options',
maxfiles => 'natural',
};
my $required_config = {
@ -171,6 +172,7 @@ my $default_config = {
nodes => 0,
shared => 0,
disable => 0,
maxfiles => 0,
content => [ { images => 1, rootdir => 1, vztmpl => 1, iso => 1, backup => 1, none => 1 },
{ images => 1, rootdir => 1 }],
format => [ { raw => 1, qcow2 => 1, vmdk => 1 } , 'raw' ],
@ -183,6 +185,7 @@ my $default_config = {
server => 1,
export => 1,
options => 0,
maxfiles => 0,
content => [ { images => 1, rootdir => 1, vztmpl => 1, iso => 1, backup => 1},
{ images => 1 }],
format => [ { raw => 1, qcow2 => 1, vmdk => 1 } , 'raw' ],
@ -357,6 +360,10 @@ sub check_type {
return parse_lvm_name ($value, $noerr);
} elsif ($ct eq 'portal') {
return verify_portal($value, $noerr);
} elsif ($ct eq 'natural') {
return int($value) if $value =~ m/^\d+$/;
return undef if $noerr;
die "type check ('natural') failed - got '$value'\n";
} elsif ($ct eq 'nodes') {
my $res = {};
@ -711,9 +718,9 @@ sub write_config {
foreach my $k (keys %$def) {
next if defined ($done_hash->{$k});
if (defined (my $v = $ids->{$storeid}->{$k})) {
$data .= sprint_config_line ($k, $v);
}
my $v = $ids->{$storeid}->{$k};
next if !defined($v);
$data .= sprint_config_line ($k, $v);
}
$out .= "$data\n";

View File

@ -1,3 +1,9 @@
libpve-storage-perl (2.0-15) unstable; urgency=low
* allow to set option 'maxfiles' (we will use this for vzdump)
-- Proxmox Support Team <support@proxmox.com> Wed, 21 Mar 2012 07:16:17 +0100
libpve-storage-perl (2.0-14) unstable; urgency=low
* use Digest::SHA instead of Digest::SHA1