aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/virtio-ccw.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/s390x/virtio-ccw.h')
-rw-r--r--hw/s390x/virtio-ccw.h141
1 files changed, 74 insertions, 67 deletions
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index b281896f7d..cea259685d 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -17,6 +17,7 @@
#include "hw/virtio/virtio-net.h"
#include "hw/virtio/virtio-serial.h"
#include "hw/virtio/virtio-scsi.h"
+#include "qom/object.h"
#ifdef CONFIG_VHOST_SCSI
#include "hw/virtio/vhost-scsi.h"
#endif
@@ -53,32 +54,25 @@
#define CCW_CMD_SET_VIRTIO_REV 0x83
#define TYPE_VIRTIO_CCW_DEVICE "virtio-ccw-device"
-#define VIRTIO_CCW_DEVICE(obj) \
- OBJECT_CHECK(VirtioCcwDevice, (obj), TYPE_VIRTIO_CCW_DEVICE)
-#define VIRTIO_CCW_DEVICE_CLASS(klass) \
- OBJECT_CLASS_CHECK(VirtIOCCWDeviceClass, (klass), TYPE_VIRTIO_CCW_DEVICE)
-#define VIRTIO_CCW_DEVICE_GET_CLASS(obj) \
- OBJECT_GET_CLASS(VirtIOCCWDeviceClass, (obj), TYPE_VIRTIO_CCW_DEVICE)
+typedef struct VirtIOCCWDeviceClass VirtIOCCWDeviceClass;
+typedef struct VirtioCcwDevice VirtioCcwDevice;
+DECLARE_OBJ_CHECKERS(VirtioCcwDevice, VirtIOCCWDeviceClass,
+ VIRTIO_CCW_DEVICE, TYPE_VIRTIO_CCW_DEVICE)
typedef struct VirtioBusState VirtioCcwBusState;
typedef struct VirtioBusClass VirtioCcwBusClass;
#define TYPE_VIRTIO_CCW_BUS "virtio-ccw-bus"
-#define VIRTIO_CCW_BUS(obj) \
- OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
-#define VIRTIO_CCW_BUS_GET_CLASS(obj) \
- OBJECT_GET_CLASS(VirtioCcwBusClass, (obj), TYPE_VIRTIO_CCW_BUS)
-#define VIRTIO_CCW_BUS_CLASS(klass) \
- OBJECT_CLASS_CHECK(VirtioCcwBusClass, klass, TYPE_VIRTIO_CCW_BUS)
+DECLARE_OBJ_CHECKERS(VirtioCcwBusState, VirtioCcwBusClass,
+ VIRTIO_CCW_BUS, TYPE_VIRTIO_CCW_BUS)
-typedef struct VirtioCcwDevice VirtioCcwDevice;
-typedef struct VirtIOCCWDeviceClass {
+struct VirtIOCCWDeviceClass {
CCWDeviceClass parent_class;
void (*realize)(VirtioCcwDevice *dev, Error **errp);
void (*unrealize)(VirtioCcwDevice *dev);
void (*parent_reset)(DeviceState *dev);
-} VirtIOCCWDeviceClass;
+};
/* Performance improves when virtqueue kick processing is decoupled from the
* vcpu thread using ioeventfd for some devices. */
@@ -111,92 +105,100 @@ static inline int virtio_ccw_rev_max(VirtioCcwDevice *dev)
/* virtio-scsi-ccw */
#define TYPE_VIRTIO_SCSI_CCW "virtio-scsi-ccw"
-#define VIRTIO_SCSI_CCW(obj) \
- OBJECT_CHECK(VirtIOSCSICcw, (obj), TYPE_VIRTIO_SCSI_CCW)
+typedef struct VirtIOSCSICcw VirtIOSCSICcw;
+DECLARE_INSTANCE_CHECKER(VirtIOSCSICcw, VIRTIO_SCSI_CCW,
+ TYPE_VIRTIO_SCSI_CCW)
-typedef struct VirtIOSCSICcw {
+struct VirtIOSCSICcw {
VirtioCcwDevice parent_obj;
VirtIOSCSI vdev;
-} VirtIOSCSICcw;
+};
#ifdef CONFIG_VHOST_SCSI
/* vhost-scsi-ccw */
#define TYPE_VHOST_SCSI_CCW "vhost-scsi-ccw"
-#define VHOST_SCSI_CCW(obj) \
- OBJECT_CHECK(VHostSCSICcw, (obj), TYPE_VHOST_SCSI_CCW)
+typedef struct VHostSCSICcw VHostSCSICcw;
+DECLARE_INSTANCE_CHECKER(VHostSCSICcw, VHOST_SCSI_CCW,
+ TYPE_VHOST_SCSI_CCW)
-typedef struct VHostSCSICcw {
+struct VHostSCSICcw {
VirtioCcwDevice parent_obj;
VHostSCSI vdev;
-} VHostSCSICcw;
+};
#endif
/* virtio-blk-ccw */
#define TYPE_VIRTIO_BLK_CCW "virtio-blk-ccw"
-#define VIRTIO_BLK_CCW(obj) \
- OBJECT_CHECK(VirtIOBlkCcw, (obj), TYPE_VIRTIO_BLK_CCW)
+typedef struct VirtIOBlkCcw VirtIOBlkCcw;
+DECLARE_INSTANCE_CHECKER(VirtIOBlkCcw, VIRTIO_BLK_CCW,
+ TYPE_VIRTIO_BLK_CCW)
-typedef struct VirtIOBlkCcw {
+struct VirtIOBlkCcw {
VirtioCcwDevice parent_obj;
VirtIOBlock vdev;
-} VirtIOBlkCcw;
+};
/* virtio-balloon-ccw */
#define TYPE_VIRTIO_BALLOON_CCW "virtio-balloon-ccw"
-#define VIRTIO_BALLOON_CCW(obj) \
- OBJECT_CHECK(VirtIOBalloonCcw, (obj), TYPE_VIRTIO_BALLOON_CCW)
+typedef struct VirtIOBalloonCcw VirtIOBalloonCcw;
+DECLARE_INSTANCE_CHECKER(VirtIOBalloonCcw, VIRTIO_BALLOON_CCW,
+ TYPE_VIRTIO_BALLOON_CCW)
-typedef struct VirtIOBalloonCcw {
+struct VirtIOBalloonCcw {
VirtioCcwDevice parent_obj;
VirtIOBalloon vdev;
-} VirtIOBalloonCcw;
+};
/* virtio-serial-ccw */
#define TYPE_VIRTIO_SERIAL_CCW "virtio-serial-ccw"
-#define VIRTIO_SERIAL_CCW(obj) \
- OBJECT_CHECK(VirtioSerialCcw, (obj), TYPE_VIRTIO_SERIAL_CCW)
+typedef struct VirtioSerialCcw VirtioSerialCcw;
+DECLARE_INSTANCE_CHECKER(VirtioSerialCcw, VIRTIO_SERIAL_CCW,
+ TYPE_VIRTIO_SERIAL_CCW)
-typedef struct VirtioSerialCcw {
+struct VirtioSerialCcw {
VirtioCcwDevice parent_obj;
VirtIOSerial vdev;
-} VirtioSerialCcw;
+};
/* virtio-net-ccw */
#define TYPE_VIRTIO_NET_CCW "virtio-net-ccw"
-#define VIRTIO_NET_CCW(obj) \
- OBJECT_CHECK(VirtIONetCcw, (obj), TYPE_VIRTIO_NET_CCW)
+typedef struct VirtIONetCcw VirtIONetCcw;
+DECLARE_INSTANCE_CHECKER(VirtIONetCcw, VIRTIO_NET_CCW,
+ TYPE_VIRTIO_NET_CCW)
-typedef struct VirtIONetCcw {
+struct VirtIONetCcw {
VirtioCcwDevice parent_obj;
VirtIONet vdev;
-} VirtIONetCcw;
+};
/* virtio-rng-ccw */
#define TYPE_VIRTIO_RNG_CCW "virtio-rng-ccw"
-#define VIRTIO_RNG_CCW(obj) \
- OBJECT_CHECK(VirtIORNGCcw, (obj), TYPE_VIRTIO_RNG_CCW)
+typedef struct VirtIORNGCcw VirtIORNGCcw;
+DECLARE_INSTANCE_CHECKER(VirtIORNGCcw, VIRTIO_RNG_CCW,
+ TYPE_VIRTIO_RNG_CCW)
-typedef struct VirtIORNGCcw {
+struct VirtIORNGCcw {
VirtioCcwDevice parent_obj;
VirtIORNG vdev;
-} VirtIORNGCcw;
+};
/* virtio-crypto-ccw */
#define TYPE_VIRTIO_CRYPTO_CCW "virtio-crypto-ccw"
-#define VIRTIO_CRYPTO_CCW(obj) \
- OBJECT_CHECK(VirtIOCryptoCcw, (obj), TYPE_VIRTIO_CRYPTO_CCW)
+typedef struct VirtIOCryptoCcw VirtIOCryptoCcw;
+DECLARE_INSTANCE_CHECKER(VirtIOCryptoCcw, VIRTIO_CRYPTO_CCW,
+ TYPE_VIRTIO_CRYPTO_CCW)
-typedef struct VirtIOCryptoCcw {
+struct VirtIOCryptoCcw {
VirtioCcwDevice parent_obj;
VirtIOCrypto vdev;
-} VirtIOCryptoCcw;
+};
VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch);
@@ -204,56 +206,61 @@ VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch);
#include "hw/9pfs/virtio-9p.h"
#define TYPE_VIRTIO_9P_CCW "virtio-9p-ccw"
-#define VIRTIO_9P_CCW(obj) \
- OBJECT_CHECK(V9fsCCWState, (obj), TYPE_VIRTIO_9P_CCW)
+typedef struct V9fsCCWState V9fsCCWState;
+DECLARE_INSTANCE_CHECKER(V9fsCCWState, VIRTIO_9P_CCW,
+ TYPE_VIRTIO_9P_CCW)
-typedef struct V9fsCCWState {
+struct V9fsCCWState {
VirtioCcwDevice parent_obj;
V9fsVirtioState vdev;
-} V9fsCCWState;
+};
#endif /* CONFIG_VIRTFS */
#ifdef CONFIG_VHOST_VSOCK
#define TYPE_VHOST_VSOCK_CCW "vhost-vsock-ccw"
-#define VHOST_VSOCK_CCW(obj) \
- OBJECT_CHECK(VHostVSockCCWState, (obj), TYPE_VHOST_VSOCK_CCW)
+typedef struct VHostVSockCCWState VHostVSockCCWState;
+DECLARE_INSTANCE_CHECKER(VHostVSockCCWState, VHOST_VSOCK_CCW,
+ TYPE_VHOST_VSOCK_CCW)
-typedef struct VHostVSockCCWState {
+struct VHostVSockCCWState {
VirtioCcwDevice parent_obj;
VHostVSock vdev;
-} VHostVSockCCWState;
+};
#endif /* CONFIG_VHOST_VSOCK */
#define TYPE_VIRTIO_GPU_CCW "virtio-gpu-ccw"
-#define VIRTIO_GPU_CCW(obj) \
- OBJECT_CHECK(VirtIOGPUCcw, (obj), TYPE_VIRTIO_GPU_CCW)
+typedef struct VirtIOGPUCcw VirtIOGPUCcw;
+DECLARE_INSTANCE_CHECKER(VirtIOGPUCcw, VIRTIO_GPU_CCW,
+ TYPE_VIRTIO_GPU_CCW)
-typedef struct VirtIOGPUCcw {
+struct VirtIOGPUCcw {
VirtioCcwDevice parent_obj;
VirtIOGPU vdev;
-} VirtIOGPUCcw;
+};
#define TYPE_VIRTIO_INPUT_CCW "virtio-input-ccw"
-#define VIRTIO_INPUT_CCW(obj) \
- OBJECT_CHECK(VirtIOInputCcw, (obj), TYPE_VIRTIO_INPUT_CCW)
+typedef struct VirtIOInputCcw VirtIOInputCcw;
+DECLARE_INSTANCE_CHECKER(VirtIOInputCcw, VIRTIO_INPUT_CCW,
+ TYPE_VIRTIO_INPUT_CCW)
-typedef struct VirtIOInputCcw {
+struct VirtIOInputCcw {
VirtioCcwDevice parent_obj;
VirtIOInput vdev;
-} VirtIOInputCcw;
+};
#define TYPE_VIRTIO_INPUT_HID_CCW "virtio-input-hid-ccw"
#define TYPE_VIRTIO_KEYBOARD_CCW "virtio-keyboard-ccw"
#define TYPE_VIRTIO_MOUSE_CCW "virtio-mouse-ccw"
#define TYPE_VIRTIO_TABLET_CCW "virtio-tablet-ccw"
-#define VIRTIO_INPUT_HID_CCW(obj) \
- OBJECT_CHECK(VirtIOInputHIDCcw, (obj), TYPE_VIRTIO_INPUT_HID_CCW)
+typedef struct VirtIOInputHIDCcw VirtIOInputHIDCcw;
+DECLARE_INSTANCE_CHECKER(VirtIOInputHIDCcw, VIRTIO_INPUT_HID_CCW,
+ TYPE_VIRTIO_INPUT_HID_CCW)
-typedef struct VirtIOInputHIDCcw {
+struct VirtIOInputHIDCcw {
VirtioCcwDevice parent_obj;
VirtIOInputHID vdev;
-} VirtIOInputHIDCcw;
+};
#endif