diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-14 17:08:17 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-12-14 17:08:17 +0200 |
commit | dae8b87a625cb36abd86e2549e8594b677193b4e (patch) | |
tree | 53b892f1c3c4118e177149833095be19d800c950 /monitor.c | |
parent | Merge commit '0ea5709a32085f7d14901a09d12bd35f9b267607' into stable-0.12-merge (diff) | |
parent | monitor: Introduce 'block_passwd' command (diff) | |
download | qemu-kvm-dae8b87a625cb36abd86e2549e8594b677193b4e.tar.gz qemu-kvm-dae8b87a625cb36abd86e2549e8594b677193b4e.tar.bz2 qemu-kvm-dae8b87a625cb36abd86e2549e8594b677193b4e.zip |
Merge commit 'b3dfdb5a3bae5fb3170397440dfebd579a3fcb04' into stable-0.12-merge
* commit 'b3dfdb5a3bae5fb3170397440dfebd579a3fcb04':
monitor: Introduce 'block_passwd' command
QError: Add class for invalid passwords
Conflicts:
qemu-monitor.hx
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -801,6 +801,22 @@ static void do_eject(Monitor *mon, const QDict *qdict, QObject **ret_data) eject_device(mon, bs, force); } +static void do_block_set_passwd(Monitor *mon, const QDict *qdict, + QObject **ret_data) +{ + BlockDriverState *bs; + + bs = bdrv_find(qdict_get_str(qdict, "device")); + if (!bs) { + qemu_error_new(QERR_DEVICE_NOT_FOUND, qdict_get_str(qdict, "device")); + return; + } + + if (bdrv_set_key(bs, qdict_get_str(qdict, "password")) < 0) { + qemu_error_new(QERR_INVALID_PASSWORD); + } +} + static void do_change_block(Monitor *mon, const char *device, const char *filename, const char *fmt) { |