hv: ignore the initialization of vdevs whose vbdf is unassigned

if device configuration vbdf is unassigned, then the corresponding
vdev will not be initialized, instead, the vdev will be initialized
by device model through hypercall.

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yuan Liu 2020-08-19 22:26:45 +08:00 committed by wenlingz
parent 6d0f0ebd8a
commit 1b711ed629
1 changed files with 4 additions and 1 deletions

View File

@ -653,7 +653,10 @@ static void vpci_init_vdevs(struct acrn_vm *vm)
const struct acrn_vm_config *vm_config = get_vm_config(vpci2vm(vpci)->vm_id);
for (idx = 0U; idx < vm_config->pci_dev_num; idx++) {
(void)vpci_init_vdev(vpci, &vm_config->pci_devs[idx], NULL);
/* the vdev whose vBDF is unassigned will be created by hypercall */
if ((!is_postlaunched_vm(vm)) || (vm_config->pci_devs[idx].vbdf.value != UNASSIGNED_VBDF)) {
(void)vpci_init_vdev(vpci, &vm_config->pci_devs[idx], NULL);
}
}
}