summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-02-10 23:49:50 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-19 15:18:16 -0600
commit841a12d164bdfcb6d7c3e31e4e406eec28b35b5a (patch)
treecad9638a32bc904dddffe2395dc6e376081b8768
parentdf3a578589692941bc207090ba8c4e0ab8c7c8bf (diff)
downloadqemu-841a12d164bdfcb6d7c3e31e4e406eec28b35b5a.tar.gz
qemu-841a12d164bdfcb6d7c3e31e4e406eec28b35b5a.tar.bz2
qemu-841a12d164bdfcb6d7c3e31e4e406eec28b35b5a.zip
Monitor: Convert do_eject() to cmd_new_ret()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--monitor.c6
-rw-r--r--qemu-monitor.hx2
2 files changed, 4 insertions, 4 deletions
diff --git a/monitor.c b/monitor.c
index cede36879e..e960c3831b 100644
--- a/monitor.c
+++ b/monitor.c
@@ -989,7 +989,7 @@ static int eject_device(Monitor *mon, BlockDriverState *bs, int force)
return 0;
}
-static void do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
+static int do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
BlockDriverState *bs;
int force = qdict_get_int(qdict, "force");
@@ -998,9 +998,9 @@ static void do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
bs = bdrv_find(filename);
if (!bs) {
qemu_error_new(QERR_DEVICE_NOT_FOUND, filename);
- return;
+ return -1;
}
- eject_device(mon, bs, force);
+ return eject_device(mon, bs, force);
}
static void do_block_set_passwd(Monitor *mon, const QDict *qdict,
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 0eab6db657..c1bd77335a 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -138,7 +138,7 @@ ETEXI
.params = "[-f] device",
.help = "eject a removable medium (use -f to force it)",
.user_print = monitor_user_noop,
- .mhandler.cmd_new = do_eject,
+ .cmd_new_ret = do_eject,
},
STEXI