Fix sysinfo regression

The cleanup to sysinfo package introduced a regression.

If memory cgroup isn't supported and --memory is specified when
starting a container, we should return info instead of nil in
checkCgroupMem(), otherwise we'll access a nil pointer.

Signed-off-by: Zefan Li <lizefan@huawei.com>
Upstream-commit: 439869320177f56a559ef189f5ce29f24cf99e12
Component: engine
This commit is contained in:
Zefan Li
2015-06-19 09:44:23 +08:00
parent 767f006e91
commit 46e26ed16e

View File

@ -38,7 +38,7 @@ func checkCgroupMem(quiet bool) *cgroupMemInfo {
if !quiet {
logrus.Warnf("Your kernel does not support cgroup memory limit: %v", err)
}
return nil
return info
}
info.MemoryLimit = true
@ -61,7 +61,7 @@ func checkCgroupCpu(quiet bool) *cgroupCpuInfo {
if !quiet {
logrus.Warn(err)
}
return nil
return info
}
info.CpuCfsPeriod = cgroupEnabled(mountPoint, "cpu.cfs_period_us")