aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/pci-hotplug.c14
-rw-r--r--qemu-monitor.hx2
-rw-r--r--sysemu.h6
3 files changed, 11 insertions, 11 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 6cc70d52c5..bd82c6aab7 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"));
}
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 2831055a74..e987cf100c 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -874,7 +874,7 @@ ETEXI
.params = "[[<domain>:]<bus>:]<slot>",
.help = "hot remove PCI device",
.user_print = monitor_user_noop,
- .mhandler.cmd_new = do_pci_device_hot_remove,
+ .cmd_new_ret = do_pci_device_hot_remove,
},
#endif
diff --git a/sysemu.h b/sysemu.h
index d41a338fe2..8ba618e54f 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -215,9 +215,9 @@ DriveInfo *add_init_drive(const char *opts);
void pci_device_hot_add_print(Monitor *mon, const QObject *data);
int pci_device_hot_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
void drive_hot_add(Monitor *mon, const QDict *qdict);
-void pci_device_hot_remove(Monitor *mon, const char *pci_addr);
-void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
- QObject **ret_data);
+int pci_device_hot_remove(Monitor *mon, const char *pci_addr);
+int do_pci_device_hot_remove(Monitor *mon, const QDict *qdict,
+ QObject **ret_data);
/* serial ports */