Skip to content

Commit

Permalink
Add default value 0 when specific cpu toplogy file is missing
Browse files Browse the repository at this point in the history
Signed-off-by: liang-cong-red-hat <[email protected]>
  • Loading branch information
liang-cong-red-hat committed Jan 2, 2025
1 parent 4a64758 commit c614c2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libvirt/tests/cfg/numa/numa_capabilities.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
status_error = "no"
variants:
- default:
aarch64:
default_cpu_topology_key = 'die_id'

5 changes: 5 additions & 0 deletions libvirt/tests/src/numa/numa_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def run(test, params, env):
"""
Test capabilities with host numa node topology
"""
default_cpu_topology_key = params.get("default_cpu_topology_key")
libvirtd = utils_libvirtd.Libvirtd()
libvirtd.start()
try:
Expand Down Expand Up @@ -49,6 +50,10 @@ def run(test, params, env):
cpu_topo_list = []
for cpu_id in cpu_list:
cpu_dict = node_.get_cpu_topology(cpu_id)
# if specific cpu topology file from sysfs doesn't exist, default 0
# would be used in virsh capabilities
if default_cpu_topology_key and cpu_dict[default_cpu_topology_key] is None:
cpu_dict[default_cpu_topology_key] = '0'
cpu_topo_list.append(cpu_dict)
logging.debug("cpu topology list from capabilities xml is %s",
cpu_list_from_xml)
Expand Down

0 comments on commit c614c2f

Please sign in to comment.