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.
Acked-by: Eddie Dong
@@ -653,9 +653,12 @@ 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++) {
+ /* 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);
}
}
+}
/**
* @brief assign a PCI device from SOS to target post-launched VM.
