mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-29 05:13:54 -06:00
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>
This commit is contained in:
parent
49cec38591
commit
39b888bd88
5 changed files with 12 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue