提交 f3be016d 编写于 作者: A Anthony Liguori 提交者: Andreas Färber

qdev: Fix adding of ptr properties

ptr properties have neither a get/set or a print/parse which means that when
they're added they aren't treated as static or legacy properties.

Just assume properties like this are legacy properties and treat them as such.
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 8185bfc1
......@@ -576,9 +576,12 @@ void qdev_property_add_legacy(DeviceState *dev, Property *prop,
{
gchar *name, *type;
if (!prop->info->print && !prop->info->parse) {
/* Register pointer properties as legacy properties */
if (!prop->info->print && !prop->info->parse &&
(prop->info->set || prop->info->get)) {
return;
}
name = g_strdup_printf("legacy-%s", prop->name);
type = g_strdup_printf("legacy<%s>",
prop->info->legacy_name ?: prop->info->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册