[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/7] vfio: ap-device: make it more QOMConventional
From: |
Li Qiang |
Subject: |
[Qemu-devel] [PATCH 2/7] vfio: ap-device: make it more QOMConventional |
Date: |
Thu, 18 Oct 2018 22:20:07 -0700 |
As the documentation says "use TYPE_FOO constants"
This also changes the parent of ap-device's MACRO.
Signed-off-by: Li Qiang <address@hidden>
---
hw/s390x/ap-device.c | 2 +-
hw/vfio/ap.c | 12 ++++++------
include/hw/s390x/ap-device.h | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/hw/s390x/ap-device.c b/hw/s390x/ap-device.c
index f5ac8db..64a5f11 100644
--- a/hw/s390x/ap-device.c
+++ b/hw/s390x/ap-device.c
@@ -22,7 +22,7 @@ static void ap_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo ap_device_info = {
- .name = AP_DEVICE_TYPE,
+ .name = TYPE_AP_DEVICE,
.parent = TYPE_DEVICE,
.instance_size = sizeof(APDevice),
.class_size = sizeof(DeviceClass),
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index 3962bb7..b332395 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -28,7 +28,7 @@
#include "hw/s390x/ap-bridge.h"
#include "exec/address-spaces.h"
-#define VFIO_AP_DEVICE_TYPE "vfio-ap"
+#define TYPE_VFIO_AP_DEVICE "vfio-ap"
typedef struct VFIOAPDevice {
APDevice apdev;
@@ -36,7 +36,7 @@ typedef struct VFIOAPDevice {
} VFIOAPDevice;
#define VFIO_AP_DEVICE(obj) \
- OBJECT_CHECK(VFIOAPDevice, (obj), VFIO_AP_DEVICE_TYPE)
+ OBJECT_CHECK(VFIOAPDevice, (obj), TYPE_VFIO_AP_DEVICE)
static void vfio_ap_compute_needs_reset(VFIODevice *vdev)
{
@@ -69,7 +69,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);
return NULL;
}
@@ -147,7 +147,7 @@ static void vfio_ap_reset(DeviceState *dev)
}
static const VMStateDescription vfio_ap_vmstate = {
- .name = VFIO_AP_DEVICE_TYPE,
+ .name = TYPE_VFIO_AP_DEVICE,
.unmigratable = 1,
};
@@ -167,8 +167,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,
};
diff --git a/include/hw/s390x/ap-device.h b/include/hw/s390x/ap-device.h
index 765e908..d7eced4 100644
--- a/include/hw/s390x/ap-device.h
+++ b/include/hw/s390x/ap-device.h
@@ -10,13 +10,13 @@
#ifndef HW_S390X_AP_DEVICE_H
#define HW_S390X_AP_DEVICE_H
-#define AP_DEVICE_TYPE "ap-device"
+#define TYPE_AP_DEVICE "ap-device"
typedef struct APDevice {
DeviceState parent_obj;
} APDevice;
#define AP_DEVICE(obj) \
- OBJECT_CHECK(APDevice, (obj), AP_DEVICE_TYPE)
+ OBJECT_CHECK(APDevice, (obj), TYPE_AP_DEVICE)
#endif /* HW_S390X_AP_DEVICE_H */
--
1.8.3.1
- [Qemu-devel] [PATCH 0/7] vfio: some trivial fixes, Li Qiang, 2018/10/19
- [Qemu-devel] [PATCH 5/7] vfio: platform: cleanup the notifier in error path, Li Qiang, 2018/10/19
- [Qemu-devel] [PATCH 2/7] vfio: ap-device: make it more QOMConventional,
Li Qiang <=
- [Qemu-devel] [PATCH 3/7] vfio: drop TYPE_FOO MACRO in VMStateDescription, Li Qiang, 2018/10/19
- [Qemu-devel] [PATCH 1/7] vfio-pci: make "vfio-pci-nohotplug" as MACRO, Li Qiang, 2018/10/19
- [Qemu-devel] [PATCH 6/7] vfio: platform: free timer in error path, Li Qiang, 2018/10/19
- [Qemu-devel] [PATCH 4/7] vfio: paltform: fix a typo, Li Qiang, 2018/10/19
- [Qemu-devel] [PATCH 7/7] vfio: platform: destory mutex in error path, Li Qiang, 2018/10/19
- Re: [Qemu-devel] [PATCH 0/7] vfio: some trivial fixes, Philippe Mathieu-Daudé, 2018/10/19