aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-03 16:43:22 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:26:43 -0400
commitdb1015e92e04835c9eb50c29625fe566d1202dbd (patch)
tree41fbc0bf3e3f29b7ecb339224a049e3f2a7db8fa /hw/s390x
parent1c8eef0227e2942264063f22f10a06b84e0d3fa9 (diff)
Move QOM typedefs and add missing includes
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE. Patch generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]') which will split "typdef struct { ... } TypedefName" declarations. Followed by: $ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]') which will: - move the typedefs and #defines above the type check macros - add missing #include "qom/object.h" lines if necessary Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-9-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-10-ehabkost@redhat.com> Message-Id: <20200831210740.126168-11-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/ccw-device.h10
-rw-r--r--hw/s390x/ipl.h3
-rw-r--r--hw/s390x/s390-pci-bus.h18
-rw-r--r--hw/s390x/virtio-ccw.h73
4 files changed, 63 insertions, 41 deletions
diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h
index 4e6af287e7..867547b4eb 100644
--- a/hw/s390x/ccw-device.h
+++ b/hw/s390x/ccw-device.h
@@ -15,7 +15,7 @@
#include "hw/qdev-core.h"
#include "hw/s390x/css.h"
-typedef struct CcwDevice {
+struct CcwDevice {
DeviceState parent_obj;
SubchDev *sch;
/* <cssid>.<ssid>.<device number> */
@@ -25,18 +25,20 @@ typedef struct CcwDevice {
CssDevId dev_id;
/* The actual busid of the virtual subchannel. */
CssDevId subch_id;
-} CcwDevice;
+};
+typedef struct CcwDevice CcwDevice;
extern const VMStateDescription vmstate_ccw_dev;
#define VMSTATE_CCW_DEVICE(_field, _state) \
VMSTATE_STRUCT(_field, _state, 1, vmstate_ccw_dev, CcwDevice)
-typedef struct CCWDeviceClass {
+struct CCWDeviceClass {
DeviceClass parent_class;
void (*unplug)(HotplugHandler *, DeviceState *, Error **);
void (*realize)(CcwDevice *, Error **);
void (*refill_ids)(CcwDevice *);
-} CCWDeviceClass;
+};
+typedef struct CCWDeviceClass CCWDeviceClass;
static inline CcwDevice *to_ccw_dev_fast(DeviceState *d)
{
diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h
index 53cc9eb5ac..282b22cc4f 100644
--- a/hw/s390x/ipl.h
+++ b/hw/s390x/ipl.h
@@ -16,6 +16,7 @@
#include "cpu.h"
#include "exec/address-spaces.h"
#include "hw/qdev-core.h"
+#include "qom/object.h"
struct IPLBlockPVComp {
uint64_t tweak_pref;
@@ -152,6 +153,7 @@ struct QemuIplParameters {
typedef struct QemuIplParameters QemuIplParameters;
#define TYPE_S390_IPL "s390-ipl"
+typedef struct S390IPLState S390IPLState;
#define S390_IPL(obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL)
struct S390IPLState {
@@ -183,7 +185,6 @@ struct S390IPLState {
uint16_t devno;
bool iplbext_migration;
};
-typedef struct S390IPLState S390IPLState;
QEMU_BUILD_BUG_MSG(offsetof(S390IPLState, iplb) & 3, "alignment of iplb wrong");
#define DIAG_308_RC_OK 0x0001
diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h
index 550f3cc5e9..06f046e73a 100644
--- a/hw/s390x/s390-pci-bus.h
+++ b/hw/s390x/s390-pci-bus.h
@@ -19,6 +19,7 @@
#include "hw/s390x/sclp.h"
#include "hw/s390x/s390_flic.h"
#include "hw/s390x/css.h"
+#include "qom/object.h"
#define TYPE_S390_PCI_HOST_BRIDGE "s390-pcihost"
#define TYPE_S390_PCI_BUS "s390-pcibus"
@@ -36,12 +37,16 @@
#define UID_UNDEFINED 0
#define UID_CHECKING_ENABLED 0x01
+typedef struct S390pciState S390pciState;
#define S390_PCI_HOST_BRIDGE(obj) \
OBJECT_CHECK(S390pciState, (obj), TYPE_S390_PCI_HOST_BRIDGE)
+typedef struct S390PCIBus S390PCIBus;
#define S390_PCI_BUS(obj) \
OBJECT_CHECK(S390PCIBus, (obj), TYPE_S390_PCI_BUS)
+typedef struct S390PCIBusDevice S390PCIBusDevice;
#define S390_PCI_DEVICE(obj) \
OBJECT_CHECK(S390PCIBusDevice, (obj), TYPE_S390_PCI_DEVICE)
+typedef struct S390PCIIOMMU S390PCIIOMMU;
#define S390_PCI_IOMMU(obj) \
OBJECT_CHECK(S390PCIIOMMU, (obj), TYPE_S390_PCI_IOMMU)
@@ -265,8 +270,7 @@ typedef struct S390IOTLBEntry {
uint64_t perm;
} S390IOTLBEntry;
-typedef struct S390PCIBusDevice S390PCIBusDevice;
-typedef struct S390PCIIOMMU {
+struct S390PCIIOMMU {
Object parent_obj;
S390PCIBusDevice *pbdev;
AddressSpace as;
@@ -277,7 +281,7 @@ typedef struct S390PCIIOMMU {
uint64_t pba;
uint64_t pal;
GHashTable *iotlb;
-} S390PCIIOMMU;
+};
typedef struct S390PCIIOMMUTable {
uint64_t key;
@@ -339,11 +343,11 @@ struct S390PCIBusDevice {
QTAILQ_ENTRY(S390PCIBusDevice) link;
};
-typedef struct S390PCIBus {
+struct S390PCIBus {
BusState qbus;
-} S390PCIBus;
+};
-typedef struct S390pciState {
+struct S390pciState {
PCIHostState parent_obj;
uint32_t next_idx;
int bus_no;
@@ -352,7 +356,7 @@ typedef struct S390pciState {
GHashTable *zpci_table;
QTAILQ_HEAD(, SeiContainer) pending_sei;
QTAILQ_HEAD(, S390PCIBusDevice) zpci_devs;
-} S390pciState;
+};
S390pciState *s390_get_phb(void);
int pci_chsc_sei_nt2_get_event(void *res);
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index b281896f7d..c046c816c9 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,6 +54,8 @@
#define CCW_CMD_SET_VIRTIO_REV 0x83
#define TYPE_VIRTIO_CCW_DEVICE "virtio-ccw-device"
+typedef struct VirtIOCCWDeviceClass VirtIOCCWDeviceClass;
+typedef struct VirtioCcwDevice VirtioCcwDevice;
#define VIRTIO_CCW_DEVICE(obj) \
OBJECT_CHECK(VirtioCcwDevice, (obj), TYPE_VIRTIO_CCW_DEVICE)
#define VIRTIO_CCW_DEVICE_CLASS(klass) \
@@ -71,14 +74,13 @@ typedef struct VirtioBusClass VirtioCcwBusClass;
#define VIRTIO_CCW_BUS_CLASS(klass) \
OBJECT_CLASS_CHECK(VirtioCcwBusClass, klass, 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 +113,100 @@ static inline int virtio_ccw_rev_max(VirtioCcwDevice *dev)
/* virtio-scsi-ccw */
#define TYPE_VIRTIO_SCSI_CCW "virtio-scsi-ccw"
+typedef struct VirtIOSCSICcw VirtIOSCSICcw;
#define VIRTIO_SCSI_CCW(obj) \
OBJECT_CHECK(VirtIOSCSICcw, (obj), 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"
+typedef struct VHostSCSICcw VHostSCSICcw;
#define VHOST_SCSI_CCW(obj) \
OBJECT_CHECK(VHostSCSICcw, (obj), 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"
+typedef struct VirtIOBlkCcw VirtIOBlkCcw;
#define VIRTIO_BLK_CCW(obj) \
OBJECT_CHECK(VirtIOBlkCcw, (obj), 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"
+typedef struct VirtIOBalloonCcw VirtIOBalloonCcw;
#define VIRTIO_BALLOON_CCW(obj) \
OBJECT_CHECK(VirtIOBalloonCcw, (obj), 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"
+typedef struct VirtioSerialCcw VirtioSerialCcw;
#define VIRTIO_SERIAL_CCW(obj) \
OBJECT_CHECK(VirtioSerialCcw, (obj), 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"
+typedef struct VirtIONetCcw VirtIONetCcw;
#define VIRTIO_NET_CCW(obj) \
OBJECT_CHECK(VirtIONetCcw, (obj), 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"
+typedef struct VirtIORNGCcw VirtIORNGCcw;
#define VIRTIO_RNG_CCW(obj) \
OBJECT_CHECK(VirtIORNGCcw, (obj), 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"
+typedef struct VirtIOCryptoCcw VirtIOCryptoCcw;
#define VIRTIO_CRYPTO_CCW(obj) \
OBJECT_CHECK(VirtIOCryptoCcw, (obj), TYPE_VIRTIO_CRYPTO_CCW)
-typedef struct VirtIOCryptoCcw {
+struct VirtIOCryptoCcw {
VirtioCcwDevice parent_obj;
VirtIOCrypto vdev;
-} VirtIOCryptoCcw;
+};
VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch);
@@ -204,56 +214,61 @@ VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch);
#include "hw/9pfs/virtio-9p.h"
#define TYPE_VIRTIO_9P_CCW "virtio-9p-ccw"
+typedef struct V9fsCCWState V9fsCCWState;
#define VIRTIO_9P_CCW(obj) \
OBJECT_CHECK(V9fsCCWState, (obj), 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"
+typedef struct VHostVSockCCWState VHostVSockCCWState;
#define VHOST_VSOCK_CCW(obj) \
OBJECT_CHECK(VHostVSockCCWState, (obj), 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"
+typedef struct VirtIOGPUCcw VirtIOGPUCcw;
#define VIRTIO_GPU_CCW(obj) \
OBJECT_CHECK(VirtIOGPUCcw, (obj), TYPE_VIRTIO_GPU_CCW)
-typedef struct VirtIOGPUCcw {
+struct VirtIOGPUCcw {
VirtioCcwDevice parent_obj;
VirtIOGPU vdev;
-} VirtIOGPUCcw;
+};
#define TYPE_VIRTIO_INPUT_CCW "virtio-input-ccw"
+typedef struct VirtIOInputCcw VirtIOInputCcw;
#define VIRTIO_INPUT_CCW(obj) \
OBJECT_CHECK(VirtIOInputCcw, (obj), 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"
+typedef struct VirtIOInputHIDCcw VirtIOInputHIDCcw;
#define VIRTIO_INPUT_HID_CCW(obj) \
OBJECT_CHECK(VirtIOInputHIDCcw, (obj), TYPE_VIRTIO_INPUT_HID_CCW)
-typedef struct VirtIOInputHIDCcw {
+struct VirtIOInputHIDCcw {
VirtioCcwDevice parent_obj;
VirtIOInputHID vdev;
-} VirtIOInputHIDCcw;
+};
#endif