mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-12 12:39:14 +00:00
Simplify how maxfiles is determined
No functional change is intended. The preference order is: option, then storage config, then vzdump defaults. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
3a805f8d68
commit
5b6b72e6ee
@ -405,12 +405,10 @@ sub new {
|
|||||||
|
|
||||||
my $defaults = read_vzdump_defaults();
|
my $defaults = read_vzdump_defaults();
|
||||||
|
|
||||||
my $maxfiles = $opts->{maxfiles}; # save here, because we overwrite with default
|
|
||||||
|
|
||||||
$opts->{remove} = 1 if !defined($opts->{remove});
|
$opts->{remove} = 1 if !defined($opts->{remove});
|
||||||
|
|
||||||
foreach my $k (keys %$defaults) {
|
foreach my $k (keys %$defaults) {
|
||||||
next if $k eq 'exclude-path'; # dealt with separately
|
next if $k eq 'exclude-path' || $k eq 'maxfiles'; # dealt with separately
|
||||||
if ($k eq 'dumpdir' || $k eq 'storage') {
|
if ($k eq 'dumpdir' || $k eq 'storage') {
|
||||||
$opts->{$k} = $defaults->{$k} if !defined ($opts->{dumpdir}) &&
|
$opts->{$k} = $defaults->{$k} if !defined ($opts->{dumpdir}) &&
|
||||||
!defined ($opts->{storage});
|
!defined ($opts->{storage});
|
||||||
@ -466,7 +464,7 @@ sub new {
|
|||||||
$opts->{dumpdir} = $info->{dumpdir};
|
$opts->{dumpdir} = $info->{dumpdir};
|
||||||
$opts->{scfg} = $info->{scfg};
|
$opts->{scfg} = $info->{scfg};
|
||||||
$opts->{pbs} = $info->{pbs};
|
$opts->{pbs} = $info->{pbs};
|
||||||
$maxfiles //= $info->{maxfiles};
|
$opts->{maxfiles} //= $info->{maxfiles};
|
||||||
} elsif ($opts->{dumpdir}) {
|
} elsif ($opts->{dumpdir}) {
|
||||||
$errors .= "dumpdir '$opts->{dumpdir}' does not exist"
|
$errors .= "dumpdir '$opts->{dumpdir}' does not exist"
|
||||||
if ! -d $opts->{dumpdir};
|
if ! -d $opts->{dumpdir};
|
||||||
@ -474,6 +472,8 @@ sub new {
|
|||||||
die "internal error";
|
die "internal error";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$opts->{maxfiles} //= $defaults->{maxfiles};
|
||||||
|
|
||||||
if ($opts->{tmpdir} && ! -d $opts->{tmpdir}) {
|
if ($opts->{tmpdir} && ! -d $opts->{tmpdir}) {
|
||||||
$errors .= "\n" if $errors;
|
$errors .= "\n" if $errors;
|
||||||
$errors .= "tmpdir '$opts->{tmpdir}' does not exist";
|
$errors .= "tmpdir '$opts->{tmpdir}' does not exist";
|
||||||
@ -485,10 +485,7 @@ sub new {
|
|||||||
die "$errors\n";
|
die "$errors\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$opts->{maxfiles} = $maxfiles if defined($maxfiles);
|
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_mount_info {
|
sub get_mount_info {
|
||||||
|
Loading…
Reference in New Issue
Block a user