From a3a55a2edb7c0fd72bc62a8a4c719a1e1983e6ac Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 4 Dec 2009 15:24:09 -0200 Subject: monitor: Introduce 'block_passwd' command When using encrypted disk images, QEMU will prompt the user for passwords when started. This makes sense for the user protocol, but doesn't for QMP. The solution is to have Monitor command which allows the user or a Client to set passwords in advance, so that we avoid the prompt completely. This is what block_passwd does, for example: (QEMU) block_passwd ide0-hd0 foobar Signed-off-by: Luiz Capitulino Signed-off-by: Anthony Liguori --- qemu-monitor.hx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'qemu-monitor.hx') diff --git a/qemu-monitor.hx b/qemu-monitor.hx index 62e395bffd..c2670ee1d9 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -1045,6 +1045,20 @@ STEXI Close the file descriptor previously assigned to @var{fdname} using the @code{getfd} command. This is only needed if the file descriptor was never used by another monitor command. +ETEXI + + { + .name = "block_passwd", + .args_type = "device:B,password:s", + .params = "block_passwd device password", + .help = "set the password of encrypted block devices", + .user_print = monitor_user_noop, + .mhandler.cmd_new = do_block_set_passwd, + }, + +STEXI +@item block_passwd @var{device} @var{password} +Set the encrypted device @var{device} password to @var{password} ETEXI STEXI -- cgit v1.2.3