From 7ce7ffe02750c73e4dce9fd61d25d0fd0b793a2e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sat, 8 Feb 2014 11:01:48 +0100 Subject: [PATCH] qdev: Legacy properties are just strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prop->info->legacy_name is still used by "-device foo,?". Reviewed-by: Igor Mammedov Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini Signed-off-by: Andreas Färber --- hw/core/qdev.c | 8 ++------ 1 file 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); }