OSDN Git Service

bus: do not unref hotplug handler
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 7 Feb 2017 09:57:26 +0000 (09:57 +0000)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 1 Mar 2017 07:51:28 +0000 (11:51 +0400)
commit675f22c6d3b0b4b66efa27f978f2bd9575b5a5ab
tree87d608aeb1f5cab43cd4d0069ad221535bb81864
parent2b880bcdbeb87b9cb4e325dd6e872373458f82d9
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>
hw/acpi/piix4.c
hw/core/bus.c