diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-09 11:06:57 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-03 10:41:05 -0600 |
commit | 6e008585eb0a771e5011602e1bf2bf299b64457d (patch) | |
tree | b732ab4e76493348cb3be62cd6e12b69e64d7820 /hw/qdev.h | |
parent | 4be9f0d11cf2dbb1eb3f55b33c87d6df3aa7d578 (diff) |
qdev: remove info from class
Now DeviceInfo is no longer used after object construction. All of the
relevant members have been moved to DeviceClass.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev.h')
-rw-r--r-- | hw/qdev.h | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -72,10 +72,30 @@ typedef struct DeviceProperty #define DEVICE_CLASS(klass) OBJECT_CLASS_CHECK(DeviceClass, (klass), TYPE_DEVICE) #define DEVICE_GET_CLASS(obj) OBJECT_GET_CLASS(DeviceClass, (obj), TYPE_DEVICE) +typedef int (*qdev_initfn)(DeviceState *dev, DeviceInfo *info); +typedef int (*qdev_event)(DeviceState *dev); +typedef void (*qdev_resetfn)(DeviceState *dev); + typedef struct DeviceClass { ObjectClass parent_class; - DeviceInfo *info; + + const char *fw_name; + const char *alias; + const char *desc; + Property *props; + int no_user; + + /* callbacks */ void (*reset)(DeviceState *dev); + + /* device state */ + const VMStateDescription *vmsd; + + /* Private to qdev / bus. */ + qdev_initfn init; + qdev_event unplug; + qdev_event exit; + BusInfo *bus_info; } DeviceClass; /* This structure should not be accessed directly. We declare it here @@ -213,10 +233,6 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name); /*** Device API. ***/ -typedef int (*qdev_initfn)(DeviceState *dev, DeviceInfo *info); -typedef int (*qdev_event)(DeviceState *dev); -typedef void (*qdev_resetfn)(DeviceState *dev); - struct DeviceInfo { const char *name; const char *fw_name; |