mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Monitor: Convert pci_device_hot_remove() to cmd_new_ret()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
395560c8d1
commit
053801bc49
3 changed files with 11 additions and 11 deletions
|
@ -296,26 +296,26 @@ int pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
|
|||
}
|
||||
#endif
|
||||
|
||||
void pci_device_hot_remove(Monitor *mon, const char *pci_addr)
|
||||
int pci_device_hot_remove(Monitor *mon, const char *pci_addr)
|
||||
{
|
||||
PCIDevice *d;
|
||||
int dom, bus;
|
||||
unsigned slot;
|
||||
|
||||
if (pci_read_devaddr(mon, pci_addr, &dom, &bus, &slot)) {
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
|
||||
d = pci_find_device(pci_find_root_bus(0), bus, slot, 0);
|
||||
if (!d) {
|
||||
monitor_printf(mon, "slot %d empty\n", slot);
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
qdev_unplug(&d->qdev);
|
||||
return qdev_unplug(&d->qdev);
|
||||
}
|
||||
|
||||
void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
|
||||
QObject **ret_data)
|
||||
int do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
|
||||
QObject **ret_data)
|
||||
{
|
||||
pci_device_hot_remove(mon, qdict_get_str(qdict, "pci_addr"));
|
||||
return pci_device_hot_remove(mon, qdict_get_str(qdict, "pci_addr"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue