summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-03-22 11:38:14 +0100
committerAurelien Jarno <aurelien@aurel32.net>2010-04-18 23:46:48 +0200
commit17a38eaa2fdbb9add961e974fdb1b0ca8260813c (patch)
treec57e16e9edb6001fc9878cb7851194b58609d476 /hw
parentcc601cb785bbbd1a017d05d69763cd2c2e1ca3a4 (diff)
downloadqemu-17a38eaa2fdbb9add961e974fdb1b0ca8260813c.tar.gz
qemu-17a38eaa2fdbb9add961e974fdb1b0ca8260813c.tar.bz2
qemu-17a38eaa2fdbb9add961e974fdb1b0ca8260813c.zip
monitor: convert do_device_del() to QObject, QError
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/qdev.c8
-rw-r--r--hw/qdev.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index 0612dc0ba5..5ca126b49f 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -799,15 +799,15 @@ int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
return 0;
}
-void do_device_del(Monitor *mon, const QDict *qdict)
+int do_device_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
const char *id = qdict_get_str(qdict, "id");
DeviceState *dev;
dev = qdev_find_recursive(main_system_bus, id);
if (NULL == dev) {
- error_report("Device '%s' not found", id);
- return;
+ qerror_report(QERR_DEVICE_NOT_FOUND, id);
+ return -1;
}
- qdev_unplug(dev);
+ return qdev_unplug(dev);
}
diff --git a/hw/qdev.h b/hw/qdev.h
index 9475705b7b..40373c856d 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -176,7 +176,7 @@ void qbus_free(BusState *bus);
void do_info_qtree(Monitor *mon);
void do_info_qdm(Monitor *mon);
int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
-void do_device_del(Monitor *mon, const QDict *qdict);
+int do_device_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
/*** qdev-properties.c ***/