diff options
| author | Igor Mammedov <imammedo@redhat.com> | 2014-09-26 09:28:17 +0000 |
|---|---|---|
| committer | Andreas Färber <afaerber@suse.de> | 2014-10-15 05:03:13 +0200 |
| commit | 39b888bd88296b178082b5a2e4c6e82fcbd877f8 (patch) | |
| tree | c5fac970065e85e7fa65d81f64e3ef1271555cc7 /include/hw/qdev-core.h | |
| parent | 49cec38591d6fef833cf12873fb4ff9748d0f08b (diff) | |
| download | focaccia-qemu-39b888bd88296b178082b5a2e4c6e82fcbd877f8.tar.gz focaccia-qemu-39b888bd88296b178082b5a2e4c6e82fcbd877f8.zip | |
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.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 178fee2ef6..48a96d28ff 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 |