aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev-monitor.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-01-30 08:55:55 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-03 10:41:08 -0600
commit57c9fafe0f759c9f1efa5451662b3627f9bb95e0 (patch)
tree6a097cdea9a82e94cbd696a45e3e5faac917881b /hw/qdev-monitor.c
parent0beb4942071e385c16deba03848898865842edc7 (diff)
qom: move properties from qdev to object
This is mostly code movement although not entirely. This makes properties part of the Object base class which means that we can now start using Object in a meaningful way outside of qdev. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev-monitor.c')
-rw-r--r--hw/qdev-monitor.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 841e1ad913..a6f0e16397 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -173,30 +173,32 @@ int qdev_device_help(QemuOpts *opts)
return 1;
}
-static DeviceState *qdev_get_peripheral(void)
+static Object *qdev_get_peripheral(void)
{
static DeviceState *dev;
if (dev == NULL) {
dev = qdev_create(NULL, "container");
- qdev_property_add_child(qdev_get_root(), "peripheral", dev, NULL);
+ object_property_add_child(object_get_root(), "peripheral",
+ OBJECT(dev), NULL);
qdev_init_nofail(dev);
}
- return dev;
+ return OBJECT(dev);
}
-static DeviceState *qdev_get_peripheral_anon(void)
+static Object *qdev_get_peripheral_anon(void)
{
static DeviceState *dev;
if (dev == NULL) {
dev = qdev_create(NULL, "container");
- qdev_property_add_child(qdev_get_root(), "peripheral-anon", dev, NULL);
+ object_property_add_child(object_get_root(), "peripheral-anon",
+ OBJECT(dev), NULL);
qdev_init_nofail(dev);
}
- return dev;
+ return OBJECT(dev);
}
static void qbus_list_bus(DeviceState *dev)
@@ -455,12 +457,13 @@ DeviceState *qdev_device_add(QemuOpts *opts)
id = qemu_opts_id(opts);
if (id) {
qdev->id = id;
- qdev_property_add_child(qdev_get_peripheral(), qdev->id, qdev, NULL);
+ object_property_add_child(qdev_get_peripheral(), qdev->id,
+ OBJECT(qdev), NULL);
} else {
static int anon_count;
gchar *name = g_strdup_printf("device[%d]", anon_count++);
- qdev_property_add_child(qdev_get_peripheral_anon(), name,
- qdev, NULL);
+ object_property_add_child(qdev_get_peripheral_anon(), name,
+ OBJECT(qdev), NULL);
g_free(name);
}
if (qemu_opt_foreach(opts, set_property, qdev, 1) != 0) {