From f5fde119f89ce0994dc578dbbac66191242a74fa Mon Sep 17 00:00:00 2001 From: Rohit Jnagal Date: Thu, 24 Jul 2014 18:23:04 +0000 Subject: [PATCH] Grab a new spec.Cpu while updating masks if cpu root didn't exist. Docker-DCO-1.1-Signed-off-by: Rohit Jnagal (github: rjnagal) --- container/raw/handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/container/raw/handler.go b/container/raw/handler.go index 32786cf5..45265b2b 100644 --- a/container/raw/handler.go +++ b/container/raw/handler.go @@ -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. cpusetRoot, ok := self.cgroupSubsystems.mountPoints["cpuset"] if ok { + if spec.Cpu == nil { + spec.Cpu = new(info.CpuSpec) + } cpusetRoot = filepath.Join(cpusetRoot, self.name) if utils.FileExists(cpusetRoot) { spec.Cpu.Mask = readString(cpusetRoot, "cpuset.cpus")