summaryrefslogtreecommitdiff
path: root/hw/acpi_piix4.c
diff options
context:
space:
mode:
authorAmos Kong <kongjianjun@gmail.com>2012-05-20 17:57:45 +0800
committerAnthony Liguori <aliguori@us.ibm.com>2012-05-29 20:19:24 -0500
commita6de8ed80e1cf47d0f372e0856e6eeb6de9bbf0e (patch)
tree7cc00113c7e10ca1081dc5d14d79c004fa0451ec /hw/acpi_piix4.c
parent9c3a596a03cc10c2d9097f057b9ccb9d557a4d5f (diff)
downloadqemu-a6de8ed80e1cf47d0f372e0856e6eeb6de9bbf0e.tar.gz
pci: call object_unparent() before free_qdev()
Start VM with 8 multiple-function block devs, hot-removing those block devs by 'device_del ...' would cause qemu abort. | (qemu) device_del virti0-0-0 | (qemu) ** |ERROR:qom/object.c:389:object_delete: assertion failed: (obj->ref == 0) It's a regression introduced by commit 57c9fafe The whole PCI slot should be removed once. Currently only one func is cleaned in pci_unplug_device(), if you try to remove a single func by monitor cmd. free_qdev() are called for all functions in slot, but unparent_delete() is only called for one function. Signed-off-by: XXXX Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/acpi_piix4.c')
-rw-r--r--hw/acpi_piix4.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 585da4e3eb..0345490ee0 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -299,6 +299,7 @@ static void acpi_piix_eject_slot(PIIX4PMState *s, unsigned slots)
if (pc->no_hotplug) {
slot_free = false;
} else {
+ object_unparent(OBJECT(dev));
qdev_free(qdev);
}
}