From 02a5c4c97422b40034f31265e0f139f7846172a8 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Wed, 11 Sep 2013 14:54:09 +0200 Subject: qdev: Drop misleading qdev_free() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The qdev_free() function name is misleading since all the function does is unlink the device from its parent. The device is not necessarily freed. The device will be freed when its QObject refcount reaches zero. It is usual for the parent (bus) to hold the final reference but there are cases where something else holds a reference so "free" is a misleading name. Call object_unparent(obj) directly instead of having a qdev wrapper function. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Signed-off-by: Andreas Färber --- include/hw/qdev-core.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/qdev-core.h') diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index e191ca0bd2..f2043a69c2 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -221,7 +221,6 @@ void qdev_init_nofail(DeviceState *dev); void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, int required_for_version); void qdev_unplug(DeviceState *dev, Error **errp); -void qdev_free(DeviceState *dev); int qdev_simple_unplug_cb(DeviceState *dev); void qdev_machine_creation_done(void); bool qdev_machine_modified(void); -- cgit v1.2.3