summaryrefslogtreecommitdiffstats
path: root/hw/core
diff options
context:
space:
mode:
authorPaolo Bonzini2014-02-08 11:01:48 +0100
committerAndreas Färber2014-02-14 21:12:02 +0100
commit7ce7ffe02750c73e4dce9fd61d25d0fd0b793a2e (patch)
tree48c2a0fcc194ae1dda3726df3e28473eebe3ae49 /hw/core
parentqdev: Legacy properties are now read-only (diff)
downloadqemu-7ce7ffe02750c73e4dce9fd61d25d0fd0b793a2e.tar.gz
qemu-7ce7ffe02750c73e4dce9fd61d25d0fd0b793a2e.tar.xz
qemu-7ce7ffe02750c73e4dce9fd61d25d0fd0b793a2e.zip
qdev: Legacy properties are just strings
prop->info->legacy_name is still used by "-device foo,?". Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 7c1b7325ca..482a9780d1 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -590,7 +590,7 @@ static void qdev_get_legacy_property(Object *obj, Visitor *v, void *opaque,
void qdev_property_add_legacy(DeviceState *dev, Property *prop,
Error **errp)
{
- gchar *name, *type;
+ gchar *name;
/* Register pointer properties as legacy properties */
if (!prop->info->print && prop->info->get) {
@@ -598,16 +598,12 @@ void qdev_property_add_legacy(DeviceState *dev, Property *prop,
}
name = g_strdup_printf("legacy-%s", prop->name);
- type = g_strdup_printf("legacy<%s>",
- prop->info->legacy_name ?: prop->info->name);
-
- object_property_add(OBJECT(dev), name, type,
+ object_property_add(OBJECT(dev), name, "str",
prop->info->print ? qdev_get_legacy_property : prop->info->get,
NULL,
NULL,
prop, errp);
- g_free(type);
g_free(name);
}