[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 23/30] bus: do not unref hotplug handler

From: Marc-André Lureau
Subject: [Qemu-devel] [PATCH v2 23/30] bus: do not unref hotplug handler
Date: Tue, 21 Feb 2017 18:14:44 +0400

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 <address@hidden>
 hw/core/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/core/bus.c b/hw/core/bus.c
index cf383fc1af..4651f24486 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -197,7 +197,7 @@ static void qbus_initfn(Object *obj)
                              (Object **)&bus->hotplug_handler,
-                             OBJ_PROP_LINK_UNREF_ON_RELEASE,
+                             0,
     object_property_add_bool(obj, "realized",
                              bus_get_realized, bus_set_realized, NULL);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]