From 404319e992323c68eba17a59302f840af2160922 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 This is to fix the different cgroup path for V1. Signed-off-by: Dan Zheng --- .../src/numa/guest_numa_node_tuning/memory_binding_setting.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ec21281ef0..09ad69a1bb 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 @@ -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']: