summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-05-02 13:31:07 +0200
committerAndreas Färber <afaerber@suse.de>2012-05-12 14:19:10 +0200
commitf3be016d034b2ed97f305ce707dea0354254a817 (patch)
tree7cad40e487c0670ad3b13a401f8fb9f9f958a5f4 /hw
parent8185bfc146309bef43d6b0ed0e6afc27369ff0fa (diff)
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: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw')
-rw-r--r--hw/qdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index 0bcde20c92..6a8f6bda2b 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -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);