From: Eduardo Habkost <ehabkost@raisama.net>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] qemu: Don't try to read passwords before monitor setup
Date: Tue, 03 Feb 2009 19:07:20 -0200 [thread overview]
Message-ID: <1233691755-sup-1057@blackpad> (raw)
drive_init() calls qemu_key_check(), but it doesn't make sense to call
it before the monitor was set up. This makes qemu hang forever waiting
for a password on a monitor that doesn't exist yet.
This can be reproduced by running:
$ qemu-img create -e -f qcow2 encrypted.img 10M
Formatting 'encrypted.img', fmt=qcow2, encrypted, size=10240 kB
$ qemu-system-x86_64 -drive file=encrypted.img -monitor stdio
[qemu hangs]
Removing the qemu_key_check() call on drive_init() will make the password
to be read at a more appropriate time, at read_passwords().
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
vl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vl.c b/vl.c
index 3676537..07700e8 100644
--- a/vl.c
+++ b/vl.c
@@ -2552,7 +2552,7 @@ static int drive_init(struct drive_opt *arg, int snapshot,
bdrv_flags |= BDRV_O_CACHE_WB;
else if (cache == 3) /* not specified */
bdrv_flags |= BDRV_O_CACHE_DEF;
- if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0 || qemu_key_check(bdrv, file)) {
+ if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0) {
fprintf(stderr, "qemu: could not open disk image %s\n",
file);
return -1;
--
1.6.1
--
Eduardo
reply other threads:[~2009-02-03 21:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1233691755-sup-1057@blackpad \
--to=ehabkost@raisama.net \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).