Use QOM casts to convert between VFIOPCIDevice and PCIDevice instead of
accessing pdev directly.

Signed-off-by: Mark Cave-Ayland <mark.caveayl...@nutanix.com>
---
 hw/vfio/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index 16f092a0c6..c0c3d68742 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -206,7 +206,7 @@ static inline bool vfio_pci_is(VFIOPCIDevice *vdev, 
uint32_t vendor, uint32_t de
 
 static inline bool vfio_is_vga(VFIOPCIDevice *vdev)
 {
-    PCIDevice *pdev = &vdev->pdev;
+    PCIDevice *pdev = PCI_DEVICE(vdev);
     uint16_t class = pci_get_word(pdev->config + PCI_CLASS_DEVICE);
 
     return class == PCI_CLASS_DISPLAY_VGA;
-- 
2.43.0


Reply via email to