From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfeIc-0007HB-2S for qemu-devel@nongnu.org; Mon, 03 Dec 2012 17:15:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfeIa-00033e-Vq for qemu-devel@nongnu.org; Mon, 03 Dec 2012 17:15:37 -0500 Sender: fluxion From: Michael Roth Date: Mon, 3 Dec 2012 16:08:41 -0600 Message-Id: <1354572547-21271-18-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1354572547-21271-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1354572547-21271-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 17/43] tools: initialize main loop before block layer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-stable@nongnu.org Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org From: Paolo Bonzini Tools were broken because they initialized the block layer while qemu_aio_context was still NULL. Reported-by: malc Signed-off-by: Paolo Bonzini Signed-off-by: malc (cherry picked from commit 2592c59a66d456fe98fe96cb5787b356c40ee66f) Signed-off-by: Michael Roth --- qemu-img.c | 3 +-- qemu-io.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 7615e91..c90ae4a 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1698,14 +1698,13 @@ int main(int argc, char **argv) error_set_progname(argv[0]); + qemu_init_main_loop(); bdrv_init(); if (argc < 2) help(); cmdname = argv[1]; argc--; argv++; - qemu_init_main_loop(); - /* find the command */ for(cmd = img_cmds; cmd->name != NULL; cmd++) { if (!strcmp(cmdname, cmd->name)) { diff --git a/qemu-io.c b/qemu-io.c index d0f4fb7..1ad7d3a 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -1892,9 +1892,8 @@ int main(int argc, char **argv) exit(1); } - bdrv_init(); - qemu_init_main_loop(); + bdrv_init(); /* initialize commands */ quit_init(); -- 1.7.9.5