misc: refine the vCPU sort for cpu_affinity and CAT

The current code sort cpu list by string order, this is an issue when
we want to assign more then 10 vCPUs for some VM.

So this patch rewrite the sort of these list, now the cpu list order
by int type.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Chenli Wei
2022-08-19 23:50:45 +08:00
committed by acrnsi-robot
parent 42d2ef6d5f
commit a75660be58
3 changed files with 3 additions and 3 deletions

View File

@@ -32,5 +32,5 @@ def fn(board_etree, scenario_etree, allocation_etree):
allocation_sos_vm_node = common.append_node("/acrn-config/vm", None, allocation_etree, id = vm_id)
if common.get_node("./load_order", allocation_sos_vm_node) is None:
common.append_node("./load_order", "SERVICE_VM", allocation_sos_vm_node)
for pcpu_id in cpus_for_sos:
for pcpu_id in sorted([int(x) for x in cpus_for_sos]):
common.append_node("./cpu_affinity/pcpu_id", str(pcpu_id), allocation_sos_vm_node)