acrn-config: add pci vuart number to total pci devices number
take enabled pci vuarts to count in total pci devices number per VM
@@ -109,13 +109,17 @@ def pci_dev_num_per_vm_gen(config):
shmem_regions = scenario_cfg_lib.get_shmem_regions(ivshmem_region)
shmem_num = scenario_cfg_lib.get_shmem_num(shmem_regions)
+ vuarts = common.get_vuart_info(common.SCENARIO_INFO_FILE)
+ vuarts_num = scenario_cfg_lib.get_vuart_num(vuarts)
+
for vm_i,vm_type in common.VM_TYPES.items():
num = 0
if "POST_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
shmem_num_i = 0
+ vuart_num = vuarts_num[vm_i]
if shmem_enabled == 'y' and vm_i in shmem_num.keys():
shmem_num_i = shmem_num[vm_i]
- num = shmem_num_i
+ num = shmem_num_i + vuart_num
elif "PRE_LAUNCHED_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
shmem_num_i = 0
if shmem_enabled == 'y' and vm_i in shmem_num.keys():
@@ -124,7 +128,7 @@ def pci_dev_num_per_vm_gen(config):
# there is only vhostbridge but no passthrough device
# remove the count of vhostbridge, check get_pci_num definition
pci_dev_num[vm_i] -= 1
- num = pci_dev_num[vm_i] + shmem_num_i
+ num = pci_dev_num[vm_i] + shmem_num_i + vuarts_num[vm_i]
elif "SOS_VM" == scenario_cfg_lib.VM_DB[vm_type]['load_type']:
continue
if num > 0:
