Skip to content

Commit

Permalink
memory_binding_setting: fix cgroup v1 checking
Browse files Browse the repository at this point in the history
This is to fix the different cgroup path for V1.

Signed-off-by: Dan Zheng <[email protected]>
  • Loading branch information
dzhengfy committed Jun 30, 2023
1 parent 62bf1b9 commit 404319e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ def verify_cgroup(test_obj):
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')
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 404319e

Please sign in to comment.