Skip to content

Commit

Permalink
memory_binding_setting: fix cgroup v1 checking
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Zheng <[email protected]>
  • Loading branch information
dzhengfy committed Jun 30, 2023
1 parent 62bf1b9 commit 6a3c2d8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@ def verify_cgroup(test_obj):
mem_mode = test_obj.params.get('mem_mode')
nodeset = numa_base.convert_to_string_with_dash(test_obj.params.get('nodeset'))
vm_pid = test_obj.vm.get_pid()
cg = libvirt_cgroup.CgroupTest(vm_pid)
cpuset_mems_cgroup_path = os.path.join(cg.get_cgroup_path(), 'emulator/cpuset.mems')
cg = libvirt_cgroup.CgroupTest(vm_pid)
surfix = 'emulator/cpuset.mems' if cg.is_cgroup_v2_enabled() else 'cpuset.mems'
cpuset_mems_cgroup_path = os.path.join(cg.get_cgroup_path(controller='cpuset'), surfix)
cmd = 'cat %s' % re.escape(cpuset_mems_cgroup_path)
cpuset_mems = process.run(cmd, shell=True).stdout_text.strip()
if mem_mode in ['strict', 'restrictive']:
Expand Down

0 comments on commit 6a3c2d8

Please sign in to comment.