Patchwork [1/7] qemu-nbd: initialize main loop before block layer

login
register
mail settings
Submitter Paolo Bonzini
Date Nov. 12, 2012, 2:22 p.m.
Message ID <1352730127-32685-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/198394/
State New
Headers show

Comments

Paolo Bonzini - Nov. 12, 2012, 2:22 p.m.
qemu-nbd was broken because they initialized the block layer while
qemu_aio_context was still NULL.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qemu-nbd.c | 2 +-
 1 file modificato, 1 inserzione(+). 1 rimozione(-)

Patch

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 15bcd08..80f08d8 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -539,6 +539,7 @@  int main(int argc, char **argv)
         snprintf(sockpath, 128, SOCKET_PATH, basename(device));
     }
 
+    qemu_init_main_loop();
     bdrv_init();
     atexit(bdrv_close_all);
 
@@ -584,7 +585,6 @@  int main(int argc, char **argv)
         memset(&client_thread, 0, sizeof(client_thread));
     }
 
-    qemu_init_main_loop();
     qemu_set_fd_handler2(fd, nbd_can_accept, nbd_accept, NULL,
                          (void *)(uintptr_t)fd);