From d148211c6d64b6e59181a5b9c89117c541419cab Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 16 Dec 2011 13:41:12 -0600 Subject: ide: convert to QEMU Object Model Signed-off-by: Anthony Liguori --- hw/ide/internal.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'hw/ide/internal.h') diff --git a/hw/ide/internal.h b/hw/ide/internal.h index 00b28dfdbc..c808a0ddf8 100644 --- a/hw/ide/internal.h +++ b/hw/ide/internal.h @@ -21,7 +21,6 @@ typedef struct IDEBus IDEBus; typedef struct IDEDevice IDEDevice; -typedef struct IDEDeviceInfo IDEDeviceInfo; typedef struct IDEState IDEState; typedef struct IDEDMA IDEDMA; typedef struct IDEDMAOps IDEDMAOps; @@ -450,6 +449,19 @@ struct IDEBus { int error_status; }; +#define TYPE_IDE_DEVICE "ide-device" +#define IDE_DEVICE(obj) \ + OBJECT_CHECK(IDEDevice, (obj), TYPE_IDE_DEVICE) +#define IDE_DEVICE_CLASS(klass) \ + OBJECT_CLASS_CHECK(IDEDeviceClass, (klass), TYPE_IDE_DEVICE) +#define IDE_DEVICE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(IDEDeviceClass, (obj), TYPE_IDE_DEVICE) + +typedef struct IDEDeviceClass { + DeviceClass parent_class; + int (*init)(IDEDevice *dev); +} IDEDeviceClass; + struct IDEDevice { DeviceState qdev; uint32_t unit; @@ -458,12 +470,6 @@ struct IDEDevice { char *serial; }; -typedef int (*ide_qdev_initfn)(IDEDevice *dev); -struct IDEDeviceInfo { - DeviceInfo qdev; - ide_qdev_initfn init; -}; - #define BM_STATUS_DMAING 0x01 #define BM_STATUS_ERROR 0x02 #define BM_STATUS_INT 0x04 -- cgit v1.2.1