versatile: remove cannot_destroy_with_object_finalize_yet
commitd28fca153bb27ff965b9eb26d73327fa4d2402c8
authorLaurent Vivier <lvivier@redhat.com>
Fri, 14 Apr 2017 08:37:16 +0000 (14 10:37 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 21 Apr 2017 05:18:34 +0000 (21 07:18 +0200)
tree0f259ed171b28bf389747699e0d3a4dd12c347d7
parent40fda982f2e887f7d5cc36b8a7e3b5a07a1e6704
versatile: remove cannot_destroy_with_object_finalize_yet

cannot_destroy_with_object_finalize_yet was added by 4c315c2
("qdev: Protect device-list-properties against broken devices")
because "realview_pci" and "versatile_pci" were hanging
during "device-list-properties" cleanup (an infinite loop in
bus_unparent()).

We have this problem because the child is not removed from
the list of the PCI bus children because it has no defined parent:
qdev_set_parent_bus() set the device parent_bus pointer to bus, and
adds the device in the bus children list, but doesn't update the
device parent pointer.

To fix the problem, move all the involved parts to the realize function.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20170414083717.13641-4-lvivier@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Peter Maydell <peter.maydell@linaro.org>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
hw/pci-host/versatile.c