提交 7ce7ffe0 编写于 作者: P Paolo Bonzini 提交者: Andreas Färber

qdev: Legacy properties are just strings

prop->info->legacy_name is still used by "-device foo,?".
Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 03ff7770
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册