diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2010-02-10 23:49:56 -0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-02-19 15:18:17 -0600 |
commit | 053801bc4950ec797ab8b47b4189dcdf2a1fc016 (patch) | |
tree | cef69c54e0c0aa1d4adb74608540a77a3d00d180 /hw/pci-hotplug.c | |
parent | 395560c8d15fb7980742990d00ae63aac87d43d6 (diff) | |
download | qemu-053801bc4950ec797ab8b47b4189dcdf2a1fc016.zip qemu-053801bc4950ec797ab8b47b4189dcdf2a1fc016.tar.gz qemu-053801bc4950ec797ab8b47b4189dcdf2a1fc016.tar.bz2 |
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>
Diffstat (limited to 'hw/pci-hotplug.c')
-rw-r--r-- | hw/pci-hotplug.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 6cc70d5..bd82c6a 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -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")); } |