Skip to content

Commit

Permalink
numa: replace parse_numa_nodeset_to_str() to convert_all_nodes_to_str…
Browse files Browse the repository at this point in the history
…ing()

Signed-off-by: Qian Jianhua <[email protected]>
  • Loading branch information
QianJianhua1 committed May 15, 2024
1 parent 780b9af commit be0f1b9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def verify_cgroup_mem_binding(test_obj):
"""
mem_mode = test_obj.params.get('mem_mode')
nodeset = test_obj.params.get('nodeset')
online_nodes = libvirt_numa.parse_numa_nodeset_to_str('x-y', test_obj.online_nodes)
online_nodes = libvirt_numa.convert_all_nodes_to_string(test_obj.online_nodes)
vcpu_placement = eval(test_obj.params.get('vm_attrs')).get('placement')
vm_pid = test_obj.vm.get_pid()
cg = libvirt_cgroup.CgroupTest(vm_pid)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ 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'))
online_nodes = libvirt_numa.parse_numa_nodeset_to_str('x-y', test_obj.online_nodes)
online_nodes = libvirt_numa.convert_all_nodes_to_string(test_obj.online_nodes)
vm_pid = test_obj.vm.get_pid()
cg = libvirt_cgroup.CgroupTest(vm_pid)
surfix = 'emulator/cpuset.mems' if cg.is_cgroup_v2_enabled() else 'cpuset.mems'
Expand Down
4 changes: 1 addition & 3 deletions libvirt/tests/src/numa/numa_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ def run(test, params, env):

if numa_memory.get('nodeset'):
numa_nodeset_format = numa_memory.get('nodeset')
numa_memory['nodeset'] = libvirt_numa.parse_numa_nodeset_to_str(numa_nodeset_format,
node_list,
ignore_error=True)
numa_memory['nodeset'] = libvirt_numa.convert_all_nodes_to_string(node_list)
used_node = cpu.cpus_parser(numa_memory['nodeset'])
logging.debug("set node list is %s", used_node)
if not status_error:
Expand Down
3 changes: 1 addition & 2 deletions libvirt/tests/src/numa/numa_memory_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def mem_compare(used_node, left_node):
try:
if numa_memory.get('nodeset'):
numa_nodeset_format = numa_memory.get('nodeset')
numa_memory['nodeset'] = libvirt_numa.parse_numa_nodeset_to_str(numa_nodeset_format,
node_list)
numa_memory['nodeset'] = libvirt_numa.convert_all_nodes_to_string(node_list)
used_node = cpu.cpus_parser(numa_memory['nodeset'])
logging.debug("set node list is %s", used_node)

Expand Down
3 changes: 1 addition & 2 deletions libvirt/tests/src/virsh_cmd/domain/virsh_numatune.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ def dynamic_node_replacement(params, numa_info, test_obj):
numa_nodeset_format = params.get('numa_nodeset')
dynamic_nodeset = params.get('dynamic_nodeset', 'no') == 'yes'
if dynamic_nodeset and 'numa_nodeset' in params:
params['numa_nodeset'] = libvirt_numa.parse_numa_nodeset_to_str(numa_nodeset_format,
node_list)
params['numa_nodeset'] = libvirt_numa.convert_all_nodes_to_string(node_list)

logging.debug('The parameter "numa_nodeset" from config file is going to be replaced by: {} '
'available on this system'.format(params['numa_nodeset']))
Expand Down

0 comments on commit be0f1b9

Please sign in to comment.