Commit ee368f9f authored by Dietmar Maurer's avatar Dietmar Maurer

fix bug #300: use disk_quota default settings from /etv/vz/vz.conf

parent 18baa942
......@@ -112,6 +112,17 @@ sub get_rootdir {
return $root;
}
sub get_disk_quota {
my ($conf) = @_;
my $disk_quota = $global_vzconf->{disk_quota};
if ($conf->{disk_quota} && defined($conf->{disk_quota}->{value})) {
$disk_quota = $conf->{disk_quota}->{value};
}
return $disk_quota;
}
sub read_user_beancounters {
my $ubc = {};
......@@ -436,6 +447,7 @@ sub read_global_vz_config {
privatedir => '/var/lib/vz/private/$VEID', # note '$VEID' is a place holder
dumpdir => '/var/lib/vz/dump',
lockdir => '/var/lib/vz/lock',
disk_quota => 1,
};
my $filename = "/etc/vz/vz.conf";
......@@ -473,6 +485,9 @@ sub read_global_vz_config {
$dir =~ s/^\"(.*)\"/$1/;
$res->{lockdir} = $dir;
}
if ($data =~ m/^\s*DISK_QUOTA=(no|false|off|0)$/m) {
$res->{disk_quota} = 0;
}
return $res;
};
......
......@@ -164,7 +164,7 @@ sub phase1 {
}
}
my $disk_quota = $conf->{disk_quota}->{value};
my $disk_quota = PVE::OpenVZ::get_disk_quota($conf);
if (!defined($disk_quota) || ($disk_quota != 0)) {
$disk_quota = $self->{disk_quota} = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment