Skip to content

Commit

Permalink
monitor: guard iothread access by mon->use_io_thread
Browse files Browse the repository at this point in the history
monitor_resume() and monitor_suspend() both want to
"kick" the I/O thread if it is there, but in
monitor_suspend() lacked the use_io_thread flag condition.
This is required when we later only spawn the thread on
first use.

Signed-off-by: Wolfgang Bumiller <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
  • Loading branch information
Blub authored and Markus Armbruster committed Nov 6, 2018
1 parent 0ca70f1 commit 9a3e52e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -4292,7 +4292,7 @@ int monitor_suspend(Monitor *mon)

atomic_inc(&mon->suspend_cnt);

if (monitor_is_qmp(mon)) {
if (monitor_is_qmp(mon) && mon->use_io_thread) {
/*
* Kick I/O thread to make sure this takes effect. It'll be
* evaluated again in prepare() of the watch object.
Expand Down

0 comments on commit 9a3e52e

Please sign in to comment.