From b55440dce9c8296ea284ba878b928a6599f62ec3 Mon Sep 17 00:00:00 2001 From: Zhang Chen Date: Thu, 20 Jun 2024 16:41:21 +0800 Subject: [PATCH] config_tools: Add ivshmem region ID to launch script Add missed ivshmem region ID. If no region ID in scenario, will set 0 as default. Tracked-On: #8645 Signed-off-by: Zhang Chen Reviewed-by: Junjie Mao --- misc/config_tools/launch_config/launch_cfg_gen.py | 10 ++++++++-- misc/config_tools/schema/types.xsd | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/misc/config_tools/launch_config/launch_cfg_gen.py b/misc/config_tools/launch_config/launch_cfg_gen.py index 88c43d948..6b2af9b91 100755 --- a/misc/config_tools/launch_config/launch_cfg_gen.py +++ b/misc/config_tools/launch_config/launch_cfg_gen.py @@ -303,12 +303,18 @@ def generate_for_one_vm(board_etree, hv_scenario_etree, vm_scenario_etree, vm_id for ivshmem in eval_xpath_all(vm_scenario_etree, f"//IVSHMEM_REGION[PROVIDED_BY = 'Device Model' and .//VM_NAME = '{vm_name}']"): vbdf = eval_xpath(ivshmem, f".//VBDF/text()") slot = get_slot_by_vbdf(vbdf) - script.add_virtual_device("ivshmem", slot, options=f"dm:/{ivshmem.find('NAME').text},{ivshmem.find('IVSHMEM_SIZE').text}") + if ivshmem.find('IVSHMEM_REGION_ID') is not None: + script.add_virtual_device("ivshmem", slot, options=f"dm:/{ivshmem.find('NAME').text},{ivshmem.find('IVSHMEM_SIZE').text},{ivshmem.find('IVSHMEM_REGION_ID').text}") + else: + script.add_virtual_device("ivshmem", slot, options=f"dm:/{ivshmem.find('NAME').text},{ivshmem.find('IVSHMEM_SIZE').text},{0}") for ivshmem in eval_xpath_all(vm_scenario_etree, f"//IVSHMEM_REGION[PROVIDED_BY = 'Hypervisor' and .//VM_NAME = '{vm_name}']"): vbdf = eval_xpath(ivshmem, f".//VBDF/text()") slot = get_slot_by_vbdf(vbdf) - script.add_virtual_device("ivshmem", slot, options=f"hv:/{ivshmem.find('NAME').text},{ivshmem.find('IVSHMEM_SIZE').text}") + if ivshmem.find('IVSHMEM_REGION_ID') is not None: + script.add_virtual_device("ivshmem", slot, options=f"hv:/{ivshmem.find('NAME').text},{ivshmem.find('IVSHMEM_SIZE').text},{ivshmem.find('IVSHMEM_REGION_ID').text}") + else: + script.add_virtual_device("ivshmem", slot, options=f"hv:/{ivshmem.find('NAME').text},{ivshmem.find('IVSHMEM_SIZE').text},{0}") if eval_xpath(vm_scenario_etree, ".//console_vuart/text()") == "PCI": script.add_virtual_device("uart", options="vuart_idx:0") diff --git a/misc/config_tools/schema/types.xsd b/misc/config_tools/schema/types.xsd index 94be5c620..01ba85793 100644 --- a/misc/config_tools/schema/types.xsd +++ b/misc/config_tools/schema/types.xsd @@ -286,7 +286,7 @@ in megabytes. The value should be a power of 2 and no more than 512. - + A stable identification when multiple shared memory regions are provided.