summaryrefslogtreecommitdiffstats
path: root/hw/xen/xen_platform.c
diff options
context:
space:
mode:
authorStefan Hajnoczi2013-09-11 14:54:09 +0200
committerAndreas Färber2013-11-05 18:06:38 +0100
commit02a5c4c97422b40034f31265e0f139f7846172a8 (patch)
treed3f871e5f4c0661e231c5bbb60d03775b04166f9 /hw/xen/xen_platform.c
parentqdev-monitor: Unref device when device_add fails (diff)
downloadqemu-02a5c4c97422b40034f31265e0f139f7846172a8.tar.gz
qemu-02a5c4c97422b40034f31265e0f139f7846172a8.tar.xz
qemu-02a5c4c97422b40034f31265e0f139f7846172a8.zip
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/xen/xen_platform.c')
-rw-r--r--hw/xen/xen_platform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xen/xen_platform.c b/hw/xen/xen_platform.c
index 79bf0b33d3..70875e4122 100644
--- a/hw/xen/xen_platform.c
+++ b/hw/xen/xen_platform.c
@@ -95,7 +95,7 @@ static void unplug_nic(PCIBus *b, PCIDevice *d, void *o)
if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
PCI_CLASS_NETWORK_ETHERNET
&& strcmp(d->name, "xen-pci-passthrough") != 0) {
- qdev_free(DEVICE(d));
+ object_unparent(OBJECT(d));
}
}