mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53: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
|
@ -77,7 +77,7 @@ static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
|
|||
monitor_printf(mon, "Invalid PCI device address %s\n", devaddr);
|
||||
return NULL;
|
||||
}
|
||||
if (!((BusState*)bus)->allow_hotplug) {
|
||||
if (!qbus_is_hotpluggable(BUS(bus))) {
|
||||
monitor_printf(mon, "PCI bus doesn't support hotplug\n");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
|
|||
monitor_printf(mon, "Invalid PCI device address %s\n", devaddr);
|
||||
return NULL;
|
||||
}
|
||||
if (!((BusState*)bus)->allow_hotplug) {
|
||||
if (!qbus_is_hotpluggable(BUS(bus))) {
|
||||
monitor_printf(mon, "PCI bus doesn't support hotplug\n");
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue