aboutsummaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-06-23 17:24:15 +0100
committerMax Reitz <mreitz@redhat.com>2017-07-11 17:44:56 +0200
commit788cf9f8c8cbda53843e060540f3e91a060eb744 (patch)
treec775845394970710fb20f02bac233ba09593d987 /qemu-io.c
parent23f831c33180656c03c5112552868e1dfa096da4 (diff)
downloadqemu-788cf9f8c8cbda53843e060540f3e91a060eb744.zip
qemu-788cf9f8c8cbda53843e060540f3e91a060eb744.tar.gz
qemu-788cf9f8c8cbda53843e060540f3e91a060eb744.tar.bz2
block: rip out all traces of password prompting
Now that qcow & qcow2 are wired up to get encryption keys via the QCryptoSecret object, nothing is relying on the interactive prompting for passwords. All the code related to password prompting can thus be ripped out. Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170623162419.26068-17-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/qemu-io.c b/qemu-io.c
index 8074656..4cfa41c 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -58,7 +58,6 @@ static int openfile(char *name, int flags, bool writethrough, bool force_share,
QDict *opts)
{
Error *local_err = NULL;
- BlockDriverState *bs;
if (qemuio_blk) {
error_report("file open already, try 'help close'");
@@ -85,28 +84,9 @@ static int openfile(char *name, int flags, bool writethrough, bool force_share,
return 1;
}
- bs = blk_bs(qemuio_blk);
- if (bdrv_is_encrypted(bs) && bdrv_key_required(bs)) {
- char password[256];
- printf("Disk image '%s' is encrypted.\n", name);
- if (qemu_read_password(password, sizeof(password)) < 0) {
- error_report("No password given");
- goto error;
- }
- if (bdrv_set_key(bs, password) < 0) {
- error_report("invalid password");
- goto error;
- }
- }
-
blk_set_enable_write_cache(qemuio_blk, !writethrough);
return 0;
-
- error:
- blk_unref(qemuio_blk);
- qemuio_blk = NULL;
- return 1;
}
static void open_help(void)