mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 19:57:31 +00:00
acrn-config: add pci vuart number to total pci devices number
take enabled pci vuarts to count in total pci devices number per VM Tracked-On: #5425 Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
This commit is contained in:
parent
4f8ec75c8a
commit
6ecd58f51a
@ -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:
|
||||
|
@ -195,7 +195,7 @@ def get_pci_dev_num_per_vm():
|
||||
# there is only vhostbridge but no passthrough device
|
||||
# remove the count of vhostbridge, check get_pci_num definition
|
||||
pci_dev_num[vm_i] -= 1
|
||||
pci_dev_num_per_vm[vm_i] = pci_dev_num[vm_i] + shmem_num_i+ vuarts_num[vm_i]
|
||||
pci_dev_num_per_vm[vm_i] = pci_dev_num[vm_i] + shmem_num_i + vuarts_num[vm_i]
|
||||
elif "SOS_VM" == VM_DB[vm_type]['load_type']:
|
||||
shmem_num_i = 0
|
||||
if shmem_enabled == 'y' and vm_i in shmem_num.keys():
|
||||
|
Loading…
Reference in New Issue
Block a user