]> git.proxmox.com Git - qemu.git/commit
qdev: Drop misleading qdev_free() function
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 11 Sep 2013 12:54:09 +0000 (14:54 +0200)
committerAndreas Färber <afaerber@suse.de>
Tue, 5 Nov 2013 17:06:38 +0000 (18:06 +0100)
commit02a5c4c97422b40034f31265e0f139f7846172a8
treed3f871e5f4c0661e231c5bbb60d03775b04166f9
parentee6abeb6ec08473713848ce9028110f1684853b7
qdev: Drop misleading qdev_free() function

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 <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
15 files changed:
hw/acpi/piix4.c
hw/core/qdev.c
hw/pci/pci-hotplug-old.c
hw/pci/pci_bridge.c
hw/pci/pcie.c
hw/pci/shpc.c
hw/s390x/virtio-ccw.c
hw/scsi/scsi-bus.c
hw/usb/bus.c
hw/usb/dev-storage.c
hw/usb/host-legacy.c
hw/virtio/virtio-bus.c
hw/xen/xen_platform.c
include/hw/qdev-core.h
qdev-monitor.c