summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/core/qdev.c19
-rw-r--r--include/hw/qdev-core.h11
2 files changed, 23 insertions, 7 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 9f18520219..b1da409eeb 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -112,6 +112,25 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
bus_add_child(bus, dev);
}
+static void qbus_set_hotplug_handler_internal(BusState *bus, Object *handler,
+ Error **errp)
+{
+
+ object_property_set_link(OBJECT(bus), OBJECT(handler),
+ QDEV_HOTPLUG_HANDLER_PROPERTY, errp);
+ bus->allow_hotplug = 1;
+}
+
+void qbus_set_hotplug_handler(BusState *bus, DeviceState *handler, Error **errp)
+{
+ qbus_set_hotplug_handler_internal(bus, OBJECT(handler), errp);
+}
+
+void qbus_set_bus_hotplug_handler(BusState *bus, Error **errp)
+{
+ qbus_set_hotplug_handler_internal(bus, OBJECT(bus), errp);
+}
+
/* Create a new device. This only initializes the device state structure
and allows properties to be set. qdev_init should be called to
initialize the actual device emulation. */
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index ba812c5f9e..48e9579a88 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -363,13 +363,10 @@ extern int qdev_hotplug;
char *qdev_get_dev_path(DeviceState *dev);
-static inline void qbus_set_hotplug_handler(BusState *bus, DeviceState *handler,
- Error **errp)
-{
- object_property_set_link(OBJECT(bus), OBJECT(handler),
- QDEV_HOTPLUG_HANDLER_PROPERTY, errp);
- bus->allow_hotplug = 1;
-}
+void qbus_set_hotplug_handler(BusState *bus, DeviceState *handler,
+ Error **errp);
+
+void qbus_set_bus_hotplug_handler(BusState *bus, Error **errp);
static inline bool qbus_is_hotpluggable(BusState *bus)
{