diff mbox

[15/21] qdev: fix adding of ptr properties

Message ID 1335958273-769-16-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini May 2, 2012, 11:31 a.m. UTC
From: Anthony Liguori <aliguori@us.ibm.com>

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>
---
 hw/qdev.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Andreas Färber May 12, 2012, 12:34 p.m. UTC | #1
Am 02.05.2012 13:31, schrieb Paolo Bonzini:
> From: Anthony Liguori <aliguori@us.ibm.com>
> 
> 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>

Thanks, applied to qom-1.1 and qom-next:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-1.1
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-next

Anthony, if you have this locally already,

Acked-by: Andreas Färber <afaerber@suse.de>

Andreas
diff mbox

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index f953c51..7f18590 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -550,9 +550,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);