From dd0ba250ca83ed915ea192ab7539cdbb4e868c14 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 Feb 2012 13:08:48 +0100 Subject: qdev: let QOM free properties Drop the special free callback. Instead, register a "regular" release method in the non-legacy property. Reviewed-by: Anthony Liguori Signed-off-by: Paolo Bonzini --- hw/qdev.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'hw/qdev.c') diff --git a/hw/qdev.c b/hw/qdev.c index 0205fe7d7d..487ca5d189 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -595,7 +595,7 @@ void qdev_property_add_static(DeviceState *dev, Property *prop, object_property_add(OBJECT(dev), prop->name, prop->info->name, prop->info->get, prop->info->set, - NULL, + prop->info->release, prop, errp); } @@ -626,7 +626,6 @@ static void device_finalize(Object *obj) { DeviceState *dev = DEVICE(obj); BusState *bus; - Property *prop; DeviceClass *dc = DEVICE_GET_CLASS(dev); if (dev->state == DEV_STATE_INITIALIZED) { @@ -645,11 +644,6 @@ static void device_finalize(Object *obj) } } QTAILQ_REMOVE(&dev->parent_bus->children, dev, sibling); - for (prop = qdev_get_props(dev); prop && prop->name; prop++) { - if (prop->info->free) { - prop->info->free(dev, prop); - } - } } void device_reset(DeviceState *dev) -- cgit v1.2.3