diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2013-09-11 14:54:09 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-11-05 18:06:38 +0100 |
commit | 02a5c4c97422b40034f31265e0f139f7846172a8 (patch) | |
tree | d3f871e5f4c0661e231c5bbb60d03775b04166f9 /hw/pci/pcie.c | |
parent | ee6abeb6ec08473713848ce9028110f1684853b7 (diff) |
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>
Diffstat (limited to 'hw/pci/pcie.c')
-rw-r--r-- | hw/pci/pcie.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 268a696646..ca60cf2177 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -251,7 +251,7 @@ static int pcie_cap_slot_hotplug(DeviceState *qdev, PCI_EXP_SLTSTA_PDS); pcie_cap_slot_event(d, PCI_EXP_HP_EV_PDC); } else { - qdev_free(&pci_dev->qdev); + object_unparent(OBJECT(pci_dev)); pci_word_test_and_clear_mask(exp_cap + PCI_EXP_SLTSTA, PCI_EXP_SLTSTA_PDS); pcie_cap_slot_event(d, PCI_EXP_HP_EV_PDC); |