Skip to contentSkip to conversation

qemu-nbd: Initialise main loop earlier

PATCH In review Kevin Wolf 2 participants 2 messages Nov 12, 2012

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 qemu-nbd: Initialise main loop earlier

Since the latest AIO changes qemu-nbd would segfault because bdrv_init() requires qemu_aio_context to be initialised.

---
 qemu-nbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-nbd.c +1 -1
index 15bcd08..80f08d8 100644
@@ -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);
 
Signature · 1 line
1.7.6.5
#1 lore raw

Il 12/11/2012 13:23, Kevin Wolf ha scritto:

Quoted 2 lines

Since the latest AIO changes qemu-nbd would segfault because bdrv_init() requires qemu_aio_context to be initialised.

Thanks... I had this in my NBD queue, going to send it out later.

Paolo

Quoted 26 lines
---
 qemu-nbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-nbd.c +1 -1
index 15bcd08..80f08d8 100644
@@ -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);