Revision 053801bc hw/pci-hotplug.c
b/hw/pci-hotplug.c | ||
---|---|---|
296 | 296 |
} |
297 | 297 |
#endif |
298 | 298 |
|
299 |
void pci_device_hot_remove(Monitor *mon, const char *pci_addr)
|
|
299 |
int pci_device_hot_remove(Monitor *mon, const char *pci_addr)
|
|
300 | 300 |
{ |
301 | 301 |
PCIDevice *d; |
302 | 302 |
int dom, bus; |
303 | 303 |
unsigned slot; |
304 | 304 |
|
305 | 305 |
if (pci_read_devaddr(mon, pci_addr, &dom, &bus, &slot)) { |
306 |
return; |
|
306 |
return -1;
|
|
307 | 307 |
} |
308 | 308 |
|
309 | 309 |
d = pci_find_device(pci_find_root_bus(0), bus, slot, 0); |
310 | 310 |
if (!d) { |
311 | 311 |
monitor_printf(mon, "slot %d empty\n", slot); |
312 |
return; |
|
312 |
return -1;
|
|
313 | 313 |
} |
314 |
qdev_unplug(&d->qdev); |
|
314 |
return qdev_unplug(&d->qdev);
|
|
315 | 315 |
} |
316 | 316 |
|
317 |
void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
|
|
318 |
QObject **ret_data)
|
|
317 |
int do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
|
|
318 |
QObject **ret_data) |
|
319 | 319 |
{ |
320 |
pci_device_hot_remove(mon, qdict_get_str(qdict, "pci_addr")); |
|
320 |
return pci_device_hot_remove(mon, qdict_get_str(qdict, "pci_addr"));
|
|
321 | 321 |
} |
Also available in: Unified diff