From 39b888bd88296b178082b5a2e4c6e82fcbd877f8 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Fri, 26 Sep 2014 09:28:17 +0000 Subject: Access BusState::allow_hotplug using wraper qbus_is_hotpluggable() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It would allow to transparently switch detection whether Bus is hotpluggable from allow_hotplug field to hotplug_handler link and to drop allow_hotplug field once all users are converted to hotplug handler API. Signed-off-by: Igor Mammedov Reviewed-by: Paolo Bonzini Signed-off-by: Andreas Färber --- include/hw/qdev-core.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/hw') diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 178fee2..48a96d2 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -368,4 +368,9 @@ static inline void qbus_set_hotplug_handler(BusState *bus, DeviceState *handler, QDEV_HOTPLUG_HANDLER_PROPERTY, errp); bus->allow_hotplug = 1; } + +static inline bool qbus_is_hotpluggable(BusState *bus) +{ + return bus->allow_hotplug || bus->hotplug_handler; +} #endif -- cgit v1.1