mirror of https://github.com/xqemu/xqemu.git
qemu-nbd: initialize main loop before block layer
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>
This commit is contained in:
parent
3c5645fab3
commit
7e7f4a0efc
|
@ -539,6 +539,7 @@ int main(int argc, char **argv)
|
||||||
snprintf(sockpath, 128, SOCKET_PATH, basename(device));
|
snprintf(sockpath, 128, SOCKET_PATH, basename(device));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qemu_init_main_loop();
|
||||||
bdrv_init();
|
bdrv_init();
|
||||||
atexit(bdrv_close_all);
|
atexit(bdrv_close_all);
|
||||||
|
|
||||||
|
@ -584,7 +585,6 @@ int main(int argc, char **argv)
|
||||||
memset(&client_thread, 0, sizeof(client_thread));
|
memset(&client_thread, 0, sizeof(client_thread));
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_init_main_loop();
|
|
||||||
qemu_set_fd_handler2(fd, nbd_can_accept, nbd_accept, NULL,
|
qemu_set_fd_handler2(fd, nbd_can_accept, nbd_accept, NULL,
|
||||||
(void *)(uintptr_t)fd);
|
(void *)(uintptr_t)fd);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue