aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-02-10 23:49:52 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-19 15:18:16 -0600
commitba85d351913a05aac9773fc3924a0264b0e1a833 (patch)
tree74acc3c33e9f93146706c53a297201d368dcfa73 /monitor.c
parent584cbdb59682db8f052167dd644083076d079890 (diff)
downloadqemu-ba85d351913a05aac9773fc3924a0264b0e1a833.zip
qemu-ba85d351913a05aac9773fc3924a0264b0e1a833.tar.gz
qemu-ba85d351913a05aac9773fc3924a0264b0e1a833.tar.bz2
Monitor: Convert do_block_set_passwd() to cmd_new_ret()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index 598dbfe..0ae408a 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1006,7 +1006,7 @@ static int do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data)
return eject_device(mon, bs, force);
}
-static void do_block_set_passwd(Monitor *mon, const QDict *qdict,
+static int do_block_set_passwd(Monitor *mon, const QDict *qdict,
QObject **ret_data)
{
BlockDriverState *bs;
@@ -1014,12 +1014,15 @@ static void do_block_set_passwd(Monitor *mon, const QDict *qdict,
bs = bdrv_find(qdict_get_str(qdict, "device"));
if (!bs) {
qemu_error_new(QERR_DEVICE_NOT_FOUND, qdict_get_str(qdict, "device"));
- return;
+ return -1;
}
if (bdrv_set_key(bs, qdict_get_str(qdict, "password")) < 0) {
qemu_error_new(QERR_INVALID_PASSWORD);
+ return -1;
}
+
+ return 0;
}
static void do_change_block(Monitor *mon, const char *device,