From 3b4841b91df9c6f35fc8babe51b86e7522398dd4 Mon Sep 17 00:00:00 2001 From: Chenli Wei Date: Wed, 27 Apr 2022 17:32:39 +0800 Subject: [PATCH] misc: fix the issue of create hv node There was an issue of create hv node by clos module, the direct cause is the create logic and the indirect cause is these modules of static_allocators was not sorted before run which cause some platform have issue and CI could not found. So this patch fix the create issue and sorted the modules list to make sure all these platform could work well and get the same allocation.xml Tracked-On: #6690 Signed-off-by: Chenli Wei --- misc/config_tools/static_allocators/clos.py | 2 +- misc/config_tools/static_allocators/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/config_tools/static_allocators/clos.py b/misc/config_tools/static_allocators/clos.py index 4f555f86a..1f0476422 100644 --- a/misc/config_tools/static_allocators/clos.py +++ b/misc/config_tools/static_allocators/clos.py @@ -122,7 +122,7 @@ def alloc_clos_index(board_etree, scenario_etree, allocation_etree, mask_list): def creat_mask_list_node(board_etree, scenario_etree, allocation_etree, mask_list): allocation_hv_node = common.get_node(f"//hv", allocation_etree) if allocation_hv_node is None: - allocation_hv_node = common.append_node("//hv", None, allocation_etree, id = vm_id) + allocation_hv_node = common.append_node(f"/acrn-config/hv", None, allocation_etree) cache2_id_list = scenario_etree.xpath("//CACHE_ALLOCATION[CACHE_LEVEL = 2]/CACHE_ID/text()") cache2_id_list.sort() if common.get_node("./clos_mask[@id = l3]", allocation_hv_node) is None: diff --git a/misc/config_tools/static_allocators/main.py b/misc/config_tools/static_allocators/main.py index aa3bdc090..a1819e3e9 100755 --- a/misc/config_tools/static_allocators/main.py +++ b/misc/config_tools/static_allocators/main.py @@ -25,7 +25,7 @@ def main(args): board_etree = lxml.etree.parse(args.board) scenario_etree = lxml.etree.parse(args.scenario) allocation_etree = lxml.etree.ElementTree(element=lxml.etree.fromstring("")) - for script in [f for f in os.listdir(scripts_path) if f.endswith(".py") and f != current]: + for script in sorted([f for f in os.listdir(scripts_path) if f.endswith(".py") and f != current]): module_name = os.path.splitext(script)[0] module = import_module(f"{module_name}") module.fn(board_etree, scenario_etree, allocation_etree)