mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
bus: do not unref hotplug handler
Apparently, none of the bus owner give a reference to the hotplug handler property, do not unref it on bus release. Furthermore, a bus is allowed to be its own hotplug handler, which can be seen in qbus_set_bus_hotplug_handler() function. However, in this case, the reference can't be given to the property, or this will create a cyclic dependency and the bus will never be free. Each bus owner should manage the lifecycle of the hotplug handler. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
2b880bcdbe
commit
675f22c6d3
2 changed files with 3 additions and 1 deletions
|
@ -197,7 +197,7 @@ static void qbus_initfn(Object *obj)
|
|||
TYPE_HOTPLUG_HANDLER,
|
||||
(Object **)&bus->hotplug_handler,
|
||||
object_property_allow_set_link,
|
||||
OBJ_PROP_LINK_UNREF_ON_RELEASE,
|
||||
0,
|
||||
NULL);
|
||||
object_property_add_bool(obj, "realized",
|
||||
bus_get_realized, bus_set_realized, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue