mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
monitor: unify global init
There are many places where the monitor initializes its globals: - monitor_init_qmp_commands() at the very beginning - single function to init monitor_lock - in the first entry of monitor_init() using "is_first_init" Unify them a bit. monitor_lock is not used before monitor_init() (as confirmed by code analysis and gdb watchpoints); so we are safe delaying what was a constructor-time initialization of the mutex into the later first call to monitor_init(). Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-8-peterx@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
227a07552f
commit
6adf08dd42
3 changed files with 17 additions and 17 deletions
|
@ -16,7 +16,7 @@ extern Monitor *cur_mon;
|
|||
|
||||
bool monitor_cur_is_qmp(void);
|
||||
|
||||
void monitor_init_qmp_commands(void);
|
||||
void monitor_init_globals(void);
|
||||
void monitor_init(Chardev *chr, int flags);
|
||||
void monitor_cleanup(void);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue