aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/vfio/pci.h')
-rw-r--r--hw/vfio/pci.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index 3c0dca0..5e53d5b 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -18,6 +18,7 @@
#include "qemu/event_notifier.h"
#include "qemu/queue.h"
#include "qemu/timer.h"
+#include "qom/object.h"
#define PCI_ANY_ID (~0)
@@ -114,9 +115,11 @@ typedef struct VFIOMSIXInfo {
} VFIOMSIXInfo;
#define TYPE_VFIO_PCI "vfio-pci"
-#define PCI_VFIO(obj) OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
+typedef struct VFIOPCIDevice VFIOPCIDevice;
+DECLARE_INSTANCE_CHECKER(VFIOPCIDevice, VFIO_PCI,
+ TYPE_VFIO_PCI)
-typedef struct VFIOPCIDevice {
+struct VFIOPCIDevice {
PCIDevice pdev;
VFIODevice vbasedev;
VFIOINTx intx;
@@ -173,7 +176,7 @@ typedef struct VFIOPCIDevice {
VFIODisplay *dpy;
Error *migration_blocker;
Notifier irqchip_change_notifier;
-} VFIOPCIDevice;
+};
/* Use uin32_t for vendor & device so PCI_ANY_ID expands and cannot match hw */
static inline bool vfio_pci_is(VFIOPCIDevice *vdev, uint32_t vendor, uint32_t device)