Grab a new spec.Cpu while updating masks if cpu root didn't exist.

Docker-DCO-1.1-Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)
This commit is contained in:
Rohit Jnagal 2014-07-24 18:23:04 +00:00
parent b120cee75c
commit f5fde119f8

View File

@ -116,6 +116,9 @@ func (self *rawContainerHandler) GetSpec() (*info.ContainerSpec, error) {
// This will fail for non-unified hierarchies. We'll return the whole machine mask in that case. // This will fail for non-unified hierarchies. We'll return the whole machine mask in that case.
cpusetRoot, ok := self.cgroupSubsystems.mountPoints["cpuset"] cpusetRoot, ok := self.cgroupSubsystems.mountPoints["cpuset"]
if ok { if ok {
if spec.Cpu == nil {
spec.Cpu = new(info.CpuSpec)
}
cpusetRoot = filepath.Join(cpusetRoot, self.name) cpusetRoot = filepath.Join(cpusetRoot, self.name)
if utils.FileExists(cpusetRoot) { if utils.FileExists(cpusetRoot) {
spec.Cpu.Mask = readString(cpusetRoot, "cpuset.cpus") spec.Cpu.Mask = readString(cpusetRoot, "cpuset.cpus")