Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Commit

Permalink
Unset change name of CPUset
Browse files Browse the repository at this point in the history
  • Loading branch information
carolyn authored and Denise committed Aug 19, 2017
1 parent b2b51c6 commit 2101ce5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/compute/compute_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func setupFieldsHostConfig(fields model.InstanceFields, hostConfig *container.Ho

hostConfig.RestartPolicy = fields.RestartPolicy

hostConfig.CpusetCpus = fields.CPUsetCpus
hostConfig.CpusetCpus = fields.CPUSet

hostConfig.BlkioWeight = fields.BlkioWeight

Expand Down
2 changes: 0 additions & 2 deletions handlers/compute_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (s *ComputeTestSuite) TestNewFields(c *check.C) {
fields["cpuPeriod"] = 100000
fields["cpuQuota"] = 50000
fields["cpuSetMems"] = "0"
fields["cpuSetCpus"] = "0,1"
fields["kernelMemory"] = 10000000
fields["memory"] = 10000000
fields["memorySwappiness"] = 50
Expand Down Expand Up @@ -114,7 +113,6 @@ func (s *ComputeTestSuite) TestNewFields(c *check.C) {
c.Assert(inspect.HostConfig.CPUPeriod, check.Equals, int64(100000))
c.Assert(inspect.HostConfig.CPUQuota, check.Equals, int64(50000))
c.Assert(inspect.HostConfig.CpusetMems, check.Equals, "0")
c.Assert(inspect.HostConfig.CpusetCpus, check.Equals, "0,1")
c.Assert(inspect.HostConfig.KernelMemory, check.Equals, int64(10000000))
c.Assert(inspect.HostConfig.Memory, check.Equals, int64(10000000))
c.Assert(*(inspect.HostConfig.MemorySwappiness), check.Equals, int64(50))
Expand Down
6 changes: 3 additions & 3 deletions model/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ type InstanceFields struct {
CPUPeriod int64 `json:"cpuPeriod"`
CPUQuota int64 `json:"cpuQuota"`
CPUsetMems string `json:"cpuSetMems"`
CPUsetCpus string `json:"cpuSetCpus"`
CPURealtimePeriod int64 `json:"cpuRealtimePeriod"`
CPURealtimeRuntime int64 `json:"cpuRealtimeRuntime"`
CPUSet string
CPURealtimePeriod int64 `json:"cpuRealtimePeriod"`
CPURealtimeRuntime int64 `json:"cpuRealtimeRuntime"`
DNSOpt []string
GroupAdd []string
Isolation container.Isolation
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def test_instance_activate_cpu_set(agent):
def pre(req):
delete_container('/c861f990-4472-4fa1-960f-65171b544c28')
instance = req['data']['instanceHostMap']['instance']
instance['data']['fields']['cpuSetCpus'] = '0,1'
instance['data']['fields']['cpuSet'] = '0,1'

def preNull(req):
delete_container('/c861f990-4472-4fa1-960f-65171b544c28')
Expand Down

0 comments on commit 2101ce5

Please sign in to comment.