[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [FOR 0.12 PATCH 02/18] monitor: do_cont(): Don't ask for pa
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [FOR 0.12 PATCH 02/18] monitor: do_cont(): Don't ask for passwords |
Date: |
Mon, 7 Dec 2009 21:37:00 +0100 |
From: Luiz Capitulino <address@hidden>
The do_cont() function will ask the user to enter a password if a
device is encrypted.
This is invalid under QMP, so we raise a QERR_DEVICE_ENCRYPTED
error.
Signed-off-by: Luiz Capitulino <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
monitor.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/monitor.c b/monitor.c
index 0ff208e..50c616d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -148,7 +148,10 @@ static void monitor_read_command(Monitor *mon, int
show_prompt)
static int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
void *opaque)
{
- if (mon->rs) {
+ if (monitor_ctrl_mode(mon)) {
+ qemu_error_new(QERR_MISSING_PARAMETER, "password");
+ return -EINVAL;
+ } else if (mon->rs) {
readline_start(mon->rs, "Password: ", 1, readline_func, opaque);
/* prompt is printed on return from the command handler */
return 0;
@@ -4188,6 +4191,11 @@ void monitor_read_bdrv_key_start(Monitor *mon,
BlockDriverState *bs,
return;
}
+ if (monitor_ctrl_mode(mon)) {
+ qemu_error_new(QERR_DEVICE_ENCRYPTED, bdrv_get_device_name(bs));
+ return;
+ }
+
monitor_printf(mon, "%s (%s) is encrypted.\n", bdrv_get_device_name(bs),
bdrv_get_encrypted_filename(bs));
--
1.6.2.5
- [Qemu-devel] [FOR 0.12 PATCH 09/18] QError: New QERR_SET_PASSWD_FAILED, (continued)
- [Qemu-devel] [FOR 0.12 PATCH 09/18] QError: New QERR_SET_PASSWD_FAILED, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 13/18] monitor: convert do_closefd() to QError, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 14/18] QError: New QERR_FD_NOT_SUPPLIED, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 06/18] QError: New QERR_DEVICE_NOT_REMOVABLE, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 01/18] QError: new class for device encrypted errors, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 05/18] QError: New QERR_DEVICE_LOCKED, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 11/18] monitor: convert do_change() to QObject, QError, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 07/18] monitor: convert do_eject() to QError, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 15/18] New QERR_INVALID_PARAMETER, Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 03/18] monitor: Fix double-prompt after "change vnc passwd BLA", Markus Armbruster, 2009/12/07
- [Qemu-devel] [FOR 0.12 PATCH 02/18] monitor: do_cont(): Don't ask for passwords,
Markus Armbruster <=
- [Qemu-devel] [FOR 0.12 PATCH 17/18] monitor: convert do_getfd() to QError, Markus Armbruster, 2009/12/07
- [Qemu-devel] Re: [FOR 0.12 PATCH 00/18] QError conversions and more, Luiz Capitulino, 2009/12/08