aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2009-12-07 21:37:05 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-07 16:34:34 -0600
commit2c2a6bb860c09a80f519cd6297f1c0585a1436ec (patch)
treed0b37f1220976f01a906b1268bc1f27eaec27f1e /monitor.c
parent5cfe026475f3233a4c42351001560450886feddb (diff)
monitor: convert do_eject() to QError
Also affects do_change(), because the two share eject_device(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/monitor.c b/monitor.c
index 2db2a9851c..8a06bbeb49 100644
--- a/monitor.c
+++ b/monitor.c
@@ -748,11 +748,12 @@ static int eject_device(Monitor *mon, BlockDriverState *bs, int force)
if (bdrv_is_inserted(bs)) {
if (!force) {
if (!bdrv_is_removable(bs)) {
- monitor_printf(mon, "device is not removable\n");
+ qemu_error_new(QERR_DEVICE_NOT_REMOVABLE,
+ bdrv_get_device_name(bs));
return -1;
}
if (bdrv_is_locked(bs)) {
- monitor_printf(mon, "device is locked\n");
+ qemu_error_new(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs));
return -1;
}
}
@@ -769,7 +770,7 @@ static void do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
bs = bdrv_find(filename);
if (!bs) {
- monitor_printf(mon, "device not found\n");
+ qemu_error_new(QERR_DEVICE_NOT_FOUND, filename);
return;
}
eject_device(mon, bs, force);