Revision 053801bc

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
}
b/qemu-monitor.hx
874 874
        .params     = "[[<domain>:]<bus>:]<slot>",
875 875
        .help       = "hot remove PCI device",
876 876
        .user_print = monitor_user_noop,
877
        .mhandler.cmd_new = do_pci_device_hot_remove,
877
        .cmd_new_ret = do_pci_device_hot_remove,
878 878
    },
879 879
#endif
880 880

  
b/sysemu.h
215 215
void pci_device_hot_add_print(Monitor *mon, const QObject *data);
216 216
int pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
217 217
void drive_hot_add(Monitor *mon, const QDict *qdict);
218
void pci_device_hot_remove(Monitor *mon, const char *pci_addr);
219
void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
220
                              QObject **ret_data);
218
int pci_device_hot_remove(Monitor *mon, const char *pci_addr);
219
int do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
220
                             QObject **ret_data);
221 221

  
222 222
/* serial ports */
223 223

  

Also available in: Unified diff