summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-11-03 18:10:17 +0100
committerDoug Goldstein <cardoe@cardoe.com>2012-11-21 15:29:25 -0600
commitc02f105a3dcc5cce7e178c34875e3b03216167d8 (patch)
tree9c0ed5fe4bf90f83d0d1c046902ada2f77679620
parentxhci: fix usb name in caps (diff)
downloadqemu-kvm-c02f105a3dcc5cce7e178c34875e3b03216167d8.tar.gz
qemu-kvm-c02f105a3dcc5cce7e178c34875e3b03216167d8.tar.bz2
qemu-kvm-c02f105a3dcc5cce7e178c34875e3b03216167d8.zip
tools: initialize main loop before block layer
Tools were broken because they initialized the block layer while qemu_aio_context was still NULL. Reported-by: malc <av1474@comtv.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: malc <av1474@comtv.ru> (cherry picked from commit 2592c59a66d456fe98fe96cb5787b356c40ee66f)
-rw-r--r--qemu-img.c3
-rw-r--r--qemu-io.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/qemu-img.c b/qemu-img.c
index c8a70ffc9..27672fde6 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1663,14 +1663,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 588206744..5a95f36d2 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1877,9 +1877,8 @@ int main(int argc, char **argv)
exit(1);
}
- bdrv_init();
-
qemu_init_main_loop();
+ bdrv_init();
/* initialize commands */
quit_init();