* [Qemu-devel] [PATCH] qemu: Don't try to read passwords before monitor setup
@ 2009-02-03 21:07 Eduardo Habkost
0 siblings, 0 replies; only message in thread
From: Eduardo Habkost @ 2009-02-03 21:07 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-03 21:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 21:07 [Qemu-devel] [PATCH] qemu: Don't try to read passwords before monitor setup Eduardo Habkost
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).