mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
vl: take iothread lock very early
If the iothread lock isn't taken by the main thread, the RCU callbacks might run concurrently with the main thread. QEMU's not ready for that. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Tested-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
3180aadb1f
commit
576a94d8bc
1 changed files with 3 additions and 3 deletions
6
vl.c
6
vl.c
|
@ -2767,6 +2767,9 @@ int main(int argc, char **argv, char **envp)
|
|||
FILE *vmstate_dump_file = NULL;
|
||||
Error *main_loop_err = NULL;
|
||||
|
||||
qemu_init_cpu_loop();
|
||||
qemu_mutex_lock_iothread();
|
||||
|
||||
atexit(qemu_run_exit_notifiers);
|
||||
error_set_progname(argv[0]);
|
||||
qemu_init_exec_dir(argv[0]);
|
||||
|
@ -4102,9 +4105,6 @@ int main(int argc, char **argv, char **envp)
|
|||
|
||||
os_set_line_buffering();
|
||||
|
||||
qemu_init_cpu_loop();
|
||||
qemu_mutex_lock_iothread();
|
||||
|
||||
#ifdef CONFIG_SPICE
|
||||
/* spice needs the timers to be initialized by this point */
|
||||
qemu_spice_init();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue