1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Tue, 25 Sep 2018 10:15:06 +0200
4 Subject: [PATCH] monitor: guard iothread access by mon->use_io_thread
6 monitor_resume() and monitor_suspend() both want to
7 "kick" the I/O thread if it is there, but in
8 monitor_suspend() lacked the use_io_thread flag condition.
9 This is required when we later only spawn the thread on
12 Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
13 Reviewed-by: Eric Blake <eblake@redhat.com>
14 Reviewed-by: Peter Xu <peterx@redhat.com>
15 Message-Id: <20180925081507.11873-2-w.bumiller@proxmox.com>
16 Signed-off-by: Markus Armbruster <armbru@redhat.com>
19 1 file changed, 1 insertion(+), 1 deletion(-)
21 diff --git a/monitor.c b/monitor.c
22 index a1999e396c..836c0bbdaa 100644
25 @@ -4376,7 +4376,7 @@ int monitor_suspend(Monitor *mon)
27 atomic_inc(&mon->suspend_cnt);
29 - if (monitor_is_qmp(mon)) {
30 + if (monitor_is_qmp(mon) && mon->use_io_thread) {
32 * Kick I/O thread to make sure this takes effect. It'll be
33 * evaluated again in prepare() of the watch object.