summaryrefslogtreecommitdiffstats
path: root/include/hw/qdev-core.h
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-09-26 09:28:17 +0000
committerAndreas Färber <afaerber@suse.de>2014-10-15 05:03:13 +0200
commit39b888bd88296b178082b5a2e4c6e82fcbd877f8 (patch)
treec5fac970065e85e7fa65d81f64e3ef1271555cc7 /include/hw/qdev-core.h
parent49cec38591d6fef833cf12873fb4ff9748d0f08b (diff)
downloadhqemu-39b888bd88296b178082b5a2e4c6e82fcbd877f8.zip
hqemu-39b888bd88296b178082b5a2e4c6e82fcbd877f8.tar.gz
Access BusState::allow_hotplug using wraper qbus_is_hotpluggable()
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 <imammedo@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/hw/qdev-core.h')
-rw-r--r--include/hw/qdev-core.h5
1 files changed, 5 insertions, 0 deletions
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
OpenPOWER on IntegriCloud