diff options
author | Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> | 2015-12-13 10:08:30 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-12-17 15:24:34 +0100 |
commit | e2d4f3f75b7a67c6c14c4d2e002b7baa0847c269 (patch) | |
tree | 6a9693fdee233d125c90b86bb0dd81209b91f74a /hw | |
parent | 952970ba5651e8f6d1fec7de0366c63a79cadfdb (diff) | |
download | qemu-e2d4f3f75b7a67c6c14c4d2e002b7baa0847c269.tar.gz qemu-e2d4f3f75b7a67c6c14c4d2e002b7baa0847c269.tar.bz2 qemu-e2d4f3f75b7a67c6c14c4d2e002b7baa0847c269.zip |
vmw_pvscsi: coding: Introduce PVSCSIClass
Introduce a class type for pvscsi, and the usual
DEVICE_CLASS/DEVICE_GET_CLASS macros.
No semantic change.
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Message-Id: <1449994112-7054-5-git-send-email-shmulik.ladkani@ravellosystems.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/scsi/vmw_pvscsi.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index e785b8b6ec..00d6900346 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -48,9 +48,18 @@ (stl_le_pci_dma(&container_of(m, PVSCSIState, rings)->parent_obj, \ (m)->rs_pa + offsetof(struct PVSCSIRingsState, field), val)) +typedef struct PVSCSIClass { + PCIDeviceClass parent_class; +} PVSCSIClass; + #define TYPE_PVSCSI "pvscsi" #define PVSCSI(obj) OBJECT_CHECK(PVSCSIState, (obj), TYPE_PVSCSI) +#define PVSCSI_DEVICE_CLASS(klass) \ + OBJECT_CLASS_CHECK(PVSCSIClass, (klass), TYPE_PVSCSI) +#define PVSCSI_DEVICE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(PVSCSIClass, (obj), TYPE_PVSCSI) + /* Compatability flags for migration */ #define PVSCSI_COMPAT_OLD_PCI_CONFIGURATION_BIT 0 #define PVSCSI_COMPAT_OLD_PCI_CONFIGURATION \ @@ -1222,6 +1231,7 @@ static void pvscsi_class_init(ObjectClass *klass, void *data) static const TypeInfo pvscsi_info = { .name = TYPE_PVSCSI, .parent = TYPE_PCI_DEVICE, + .class_size = sizeof(PVSCSIClass), .instance_size = sizeof(PVSCSIState), .class_init = pvscsi_class_init, .interfaces = (InterfaceInfo[]) { |