monitor: delay monitor iothread creation
Commit d32749de moved the call to monitor_init_globals() to before os_daemonize(), making it an unsuitable place to spawn the monitor iothread as it won't be inherited over the fork() in os_daemonize(). We now spawn the thread the first time we instantiate a monitor which actually has use_io_thread == true. Instantiation of monitors happens only after os_daemonize(). We still need to create the qmp_dispatcher_bh when not using iothreads, so this now still happens in monitor_init_globals(). Signed-off-by: NWolfgang Bumiller <w.bumiller@proxmox.com> Fixes: d32749de ("monitor: move init global earlier") Message-Id: <20180925081507.11873-3-w.bumiller@proxmox.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NPeter Xu <peterx@redhat.com> Tested-by: NPeter Xu <peterx@redhat.com> [This fixes a crash on shutdown with --daemonize] Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Showing
想要评论请 注册 或 登录