hv: vpci: a minor fix about is_zombie_vf

Now we check whether a device is zombie by the ->user != NULL.

Tracked-On: #4550
Signed-off-by: Li Fei1 <fei1.li@intel.com>
This commit is contained in:
Li Fei1
2020-06-19 16:04:09 +08:00
committed by wenlingz
parent cfad047bd0
commit 82f9233d4a
3 changed files with 15 additions and 13 deletions

View File

@@ -112,6 +112,20 @@ static inline bool msicap_access(const struct pci_vdev *vdev, uint32_t offset)
return (has_msi_cap(vdev) && in_range(offset, vdev->msi.capoff, vdev->msi.caplen));
}
/**
* @brief Check if the specified vdev is a zombie VF instance
*
* @pre: The vdev is a VF instance
*
* @param vdev Pointer to vdev instance
*
* @return If the vdev is a zombie VF instance return true, otherwise return false
*/
static inline bool is_zombie_vf(const struct pci_vdev *vdev)
{
return (vdev->user == NULL);
}
void init_vdev_pt(struct pci_vdev *vdev, bool is_pf_vdev);
void deinit_vdev_pt(struct pci_vdev *vdev);
void vdev_pt_write_vbar(struct pci_vdev *vdev, uint32_t idx, uint32_t val);