From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K8JGZ-0008Ot-08 for qemu-devel@nongnu.org; Mon, 16 Jun 2008 14:17:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K8JGX-0008Nz-4x for qemu-devel@nongnu.org; Mon, 16 Jun 2008 14:17:18 -0400 Received: from [199.232.76.173] (port=60483 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K8JGW-0008Nt-W7 for qemu-devel@nongnu.org; Mon, 16 Jun 2008 14:17:17 -0400 Received: from mail.gmx.net ([213.165.64.20]:56331) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1K8JGW-0004MJ-86 for qemu-devel@nongnu.org; Mon, 16 Jun 2008 14:17:16 -0400 Message-ID: <006201c8cfdd$33247b10$0201a8c0@zeug> From: "Sebastian Herbszt" References: <019c01c8cafe$d64f6310$0201a8c0@zeug> <01f001c8cb07$28c41d90$0201a8c0@zeug> Date: Mon, 16 Jun 2008 20:14:36 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: Problem(s) with encrypted images Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org >>> 2. When I start qemu, it just hangs there waiting for (assumingly) the >>> password of the encrypted image. However I cannot find the place where the >>> prompt actually is. >> >> qemu_key_check in vl.c does use monitor_readline, so you should see a "Password:" >> prompt in the monitor window (press ctrl-alt-2 to get there). > > The initialization order seems to be wrong in main() (vl.c): > > for(i = 0; i < nb_drives_opt; i++) > if (drive_init(&drives_opt[i], snapshot, machine) == -1) > exit(1); > ... > *_display_init(); > ... > monitor_init(); > > drive_init() got > ... > if (bdrv_open2(bdrv, file, bdrv_flags, drv) < 0 || qemu_key_check(bdrv, file)) { > > and qemu_key_check depends on the monitor: > > term_printf("%s is encrypted.\n", name); > for(i = 0; i < 3; i++) { > monitor_readline("Password: ", 1, password, sizeof(password)); > Can you try this patch? It will break monitor but should read the password. - Sebastian --- vl.c.orig Mon Jun 16 18:07:39 2008 +++ vl.c Mon Jun 16 17:47:44 2008 @@ -5307,7 +5307,7 @@ static int drive_init(struct drive_opt * bdrv_flags |= BDRV_O_SNAPSHOT; if (!cache) bdrv_flags |= BDRV_O_DIRECT; - 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; --- monitor.c.orig Mon Jun 16 17:56:17 2008 +++ monitor.c Mon Jun 16 18:06:23 2008 @@ -2642,10 +2642,12 @@ static void term_event(void *opaque, int if (event != CHR_EVENT_RESET) return; +/* if (!hide_banner) term_printf("QEMU %s monitor - type 'help' for more information\n", QEMU_VERSION); monitor_start_input(); +*/ } static int is_first_init = 1;