aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/ap.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/vfio/ap.c')
-rw-r--r--hw/vfio/ap.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index cec6fe1599..582c091a24 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -28,16 +28,18 @@
#include "hw/qdev-properties.h"
#include "hw/s390x/ap-bridge.h"
#include "exec/address-spaces.h"
+#include "qom/object.h"
-#define VFIO_AP_DEVICE_TYPE "vfio-ap"
+#define TYPE_VFIO_AP_DEVICE "vfio-ap"
-typedef struct VFIOAPDevice {
+struct VFIOAPDevice {
APDevice apdev;
VFIODevice vdev;
-} VFIOAPDevice;
+};
+typedef struct VFIOAPDevice VFIOAPDevice;
-#define VFIO_AP_DEVICE(obj) \
- OBJECT_CHECK(VFIOAPDevice, (obj), VFIO_AP_DEVICE_TYPE)
+DECLARE_INSTANCE_CHECKER(VFIOAPDevice, VFIO_AP_DEVICE,
+ TYPE_VFIO_AP_DEVICE)
static void vfio_ap_compute_needs_reset(VFIODevice *vdev)
{
@@ -70,7 +72,7 @@ static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp)
if (!group_path) {
error_setg(errp, "%s: no iommu_group found for %s: %s",
- VFIO_AP_DEVICE_TYPE, vapdev->vdev.sysfsdev, gerror->message);
+ TYPE_VFIO_AP_DEVICE, vapdev->vdev.sysfsdev, gerror->message);
g_error_free(gerror);
return NULL;
}
@@ -174,8 +176,8 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo vfio_ap_info = {
- .name = VFIO_AP_DEVICE_TYPE,
- .parent = AP_DEVICE_TYPE,
+ .name = TYPE_VFIO_AP_DEVICE,
+ .parent = TYPE_AP_DEVICE,
.instance_size = sizeof(VFIOAPDevice),
.class_init = vfio_ap_class_init,
};