qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] qemu: Don't try to read passwords before monitor se


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH] qemu: Don't try to read passwords before monitor setup
Date: Tue, 03 Feb 2009 19:07:20 -0200
User-agent: Sup/git

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 <address@hidden>
---
 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 via email to

[Prev in Thread] Current Thread [Next in Thread]