summaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-11-03 18:10:17 +0100
committermalc <av1474@comtv.ru>2012-11-06 04:37:57 +0400
commit2592c59a66d456fe98fe96cb5787b356c40ee66f (patch)
tree92bbc2b291f0155335d21f95dc475abc2c0332fe /qemu-img.c
parentc878da3b27ceeed953c9f9a1eb002d59e9dcb4c6 (diff)
downloadqemu-2592c59a66d456fe98fe96cb5787b356c40ee66f.tar.gz
qemu-2592c59a66d456fe98fe96cb5787b356c40ee66f.tar.bz2
qemu-2592c59a66d456fe98fe96cb5787b356c40ee66f.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>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/qemu-img.c b/qemu-img.c
index b17bddd25c..e29e01b729 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2001,14 +2001,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)) {