aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/pci-testdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/misc/pci-testdev.c')
-rw-r--r--hw/misc/pci-testdev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 188de4d9cc..86d4816769 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -24,6 +24,7 @@
#include "qemu/event_notifier.h"
#include "qemu/module.h"
#include "sysemu/kvm.h"
+#include "qom/object.h"
typedef struct PCITestDevHdr {
uint8_t test;
@@ -78,7 +79,7 @@ enum {
#define IOTEST_ACCESS_TYPE uint8_t
#define IOTEST_ACCESS_WIDTH (sizeof(uint8_t))
-typedef struct PCITestDevState {
+struct PCITestDevState {
/*< private >*/
PCIDevice parent_obj;
/*< public >*/
@@ -90,12 +91,13 @@ typedef struct PCITestDevState {
uint64_t membar_size;
MemoryRegion membar;
-} PCITestDevState;
+};
+typedef struct PCITestDevState PCITestDevState;
#define TYPE_PCI_TEST_DEV "pci-testdev"
-#define PCI_TEST_DEV(obj) \
- OBJECT_CHECK(PCITestDevState, (obj), TYPE_PCI_TEST_DEV)
+DECLARE_INSTANCE_CHECKER(PCITestDevState, PCI_TEST_DEV,
+ TYPE_PCI_TEST_DEV)
#define IOTEST_IS_MEM(i) (strcmp(IOTEST_TYPE(i), "portio"))
#define IOTEST_REGION(d, i) (IOTEST_IS_MEM(i) ? &(d)->mmio : &(d)->portio)