hv: vpci: refine vpci deinit

The existing code do separately for each VM when we deinit vpci of a VM. This is
not necessary. This patch use the common handling for all VMs: we first deassign
it from the (current) user, then give it back to its parent user.

When we deassign the vdev from the (current) user, we would de-initialize the
vMSI/VMSI-X remapping, so does the vMSI/vMSI-X data structure.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong<eddie.dong@Intel.com>
This commit is contained in:
Li Fei1
2020-05-12 15:06:02 +08:00
committed by wenlingz
parent 15e3062631
commit f9d26a80ed
5 changed files with 54 additions and 137 deletions

View File

@@ -96,7 +96,7 @@ struct pci_vdev_ops {
};
struct pci_vdev {
const struct acrn_vpci *vpci;
struct acrn_vpci *vpci;
/* The bus/device/function triple of the virtual PCI device. */
union pci_bdf bdf;