aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-09 10:51:49 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-03 10:41:04 -0600
commit4be9f0d11cf2dbb1eb3f55b33c87d6df3aa7d578 (patch)
tree63f72eaf204e81336e4ab4341a10eaf6147c5f68 /hw/qdev.c
parentba02430f1a681173cff5336c626d6edc5ea268db (diff)
downloadqemu-4be9f0d11cf2dbb1eb3f55b33c87d6df3aa7d578.zip
qemu-4be9f0d11cf2dbb1eb3f55b33c87d6df3aa7d578.tar.gz
qemu-4be9f0d11cf2dbb1eb3f55b33c87d6df3aa7d578.tar.bz2
qdev: make DeviceInfo private
Introduce accessors and remove any code that directly accesses DeviceInfo members. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index a8c24de..18c5876 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -60,11 +60,39 @@ static void qdev_subclass_init(ObjectClass *klass, void *data)
}
}
-DeviceInfo *qdev_get_info(DeviceState *dev)
+static DeviceInfo *qdev_get_info(DeviceState *dev)
{
return DEVICE_GET_CLASS(dev)->info;
}
+const VMStateDescription *qdev_get_vmsd(DeviceState *dev)
+{
+ return qdev_get_info(dev)->vmsd;
+}
+
+BusInfo *qdev_get_bus_info(DeviceState *dev)
+{
+ return qdev_get_info(dev)->bus_info;
+}
+
+Property *qdev_get_props(DeviceState *dev)
+{
+ return qdev_get_info(dev)->props;
+}
+
+const char *qdev_fw_name(DeviceState *dev)
+{
+ DeviceInfo *info = qdev_get_info(dev);
+
+ if (info->fw_name) {
+ return info->fw_name;
+ } else if (info->alias) {
+ return info->alias;
+ }
+
+ return object_get_typename(OBJECT(dev));
+}
+
void qdev_register_subclass(DeviceInfo *info, const char *parent)
{
TypeInfo type_info = {};