[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 14/48] qemu-img/qemu-io: don't prompt for passwords i
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 14/48] qemu-img/qemu-io: don't prompt for passwords if not required |
Date: |
Tue, 29 Mar 2016 17:08:14 +0200 |
From: "Daniel P. Berrange" <address@hidden>
The qemu-img/qemu-io tools prompt for disk encryption passwords
regardless of whether any are actually required. Adding a check
on bdrv_key_required() avoids this prompt for disk formats which
have been converted to the QCryptoSecret APIs.
This is just a temporary hack to ensure the block I/O tests
continue to work after each patch, since the last patch will
completely delete all the password prompting code.
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-img.c | 3 ++-
qemu-io.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 7fa2a13..681cb70 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -230,7 +230,8 @@ static int img_open_password(BlockBackend *blk, const char
*filename,
char password[256];
bs = blk_bs(blk);
- if (bdrv_is_encrypted(bs) && !(flags & BDRV_O_NO_IO)) {
+ if (bdrv_is_encrypted(bs) && bdrv_key_required(bs) &&
+ !(flags & BDRV_O_NO_IO)) {
qprintf(quiet, "Disk image '%s' is encrypted.\n", filename);
if (qemu_read_password(password, sizeof(password)) < 0) {
error_report("No password given");
diff --git a/qemu-io.c b/qemu-io.c
index d7c2f26..1bd1158 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -69,7 +69,7 @@ static int openfile(char *name, int flags, QDict *opts)
}
bs = blk_bs(qemuio_blk);
- if (bdrv_is_encrypted(bs)) {
+ 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) {
--
1.8.3.1
- [Qemu-devel] [PULL 04/48] block: Remove cache.writeback from blockdev-add, (continued)
- [Qemu-devel] [PULL 04/48] block: Remove cache.writeback from blockdev-add, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 02/48] block: Remove copy-on-read from bdrv_move_feature_fields(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 03/48] block: Remove dirty bitmaps from bdrv_move_feature_fields(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 05/48] block: Make backing files always writeback, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 09/48] block/qapi: make two printf() formats literal, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 11/48] block/qapi: Set s->device in bdrv_query_stats(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 08/48] block: Remove blk_set_bs(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 07/48] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 06/48] block: Reject writethrough mode except at the root, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 10/48] block/qapi: fix unbounded stack for dump_qdict, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 14/48] qemu-img/qemu-io: don't prompt for passwords if not required,
Kevin Wolf <=
- [Qemu-devel] [PULL 12/48] block/qapi: Pass bdrv_query_blk_stats() s->stats, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 13/48] block: add flag to indicate that no I/O will be performed, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 15/48] tests: redirect stderr to stdout for iotests, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 16/48] tests: refactor python I/O tests helper main method, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 17/48] tests: add output filter to python I/O tests helper, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 18/48] block: add generic full disk encryption driver, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 23/48] replay: fix error message, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 19/48] block: move encryption deprecation warning into qcow code, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 21/48] block: add flush callback, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 25/48] block: Add bdrv_parse_cache_mode(), Kevin Wolf, 2016/03/29