]> git.proxmox.com Git - pve-storage.git/commitdiff
allow to set option 'maxfiles'
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 21 Mar 2012 06:17:11 +0000 (07:17 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 23 Mar 2012 06:43:28 +0000 (07:43 +0100)
Makefile
PVE/API2/Storage/Config.pm
PVE/Storage.pm
changelog.Debian

index 1a8dbc7047ad500cd0397d21b6711b7840e87671..806a07296376bca6019ff5b487641b7b259c9c41 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ RELEASE=2.0
 
 VERSION=2.0
 PACKAGE=libpve-storage-perl
-PKGREL=14
+PKGREL=15
 
 DESTDIR=
 PREFIX=/usr
index 34c2150db22ed02a5df5558dd697026696d3fb8c..4461ddd3de354b803a2067e7d7e307710c540696 100755 (executable)
@@ -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.',
index 52a6c93448a8ffe8be0c160fc31a4b3ff8bf4183..8163d177e780f7de4887bd2b7cef97ae0153d8c3 100755 (executable)
@@ -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";
index 990d37c5a22314d110a12c57b82194d1fa0094a6..b48601c94b90f93004f5142ce6cc6edf4040e8f7 100644 (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