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 <chen.zhang@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
9d7f14e783
commit
b55440dce9
|
@ -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")
|
||||
|
|
|
@ -286,7 +286,7 @@ in megabytes. The value should be a power of 2
|
|||
and no more than 512.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="IVSHMEM_REGION_ID" type="xs:integer" default="0">
|
||||
<xs:element name="IVSHMEM_REGION_ID" type="xs:string" default="0">
|
||||
<xs:annotation acrn:title="IVSHMEM Region ID">
|
||||
<xs:documentation>A stable identification when multiple shared memory regions are provided.</xs:documentation>
|
||||
</xs:annotation>
|
||||
|
|
Loading…
Reference in New Issue