From 6a3c2d80c48c58314787d672be09dd1c931d678d Mon Sep 17 00:00:00 2001 From: Dan Zheng Date: Fri, 30 Jun 2023 17:59:08 +0800 Subject: [PATCH] memory_binding_setting: fix cgroup v1 checking Signed-off-by: Dan Zheng --- .../numa/guest_numa_node_tuning/memory_binding_setting.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libvirt/tests/src/numa/guest_numa_node_tuning/memory_binding_setting.py b/libvirt/tests/src/numa/guest_numa_node_tuning/memory_binding_setting.py index ec21281ef02..26ee63fd1c5 100644 --- a/libvirt/tests/src/numa/guest_numa_node_tuning/memory_binding_setting.py +++ b/libvirt/tests/src/numa/guest_numa_node_tuning/memory_binding_setting.py @@ -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']: