From: Wolfgang Bumiller <w.bumil...@proxmox.com>

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 <w.bumil...@proxmox.com>
Reviewed-by: Eric Blake <ebl...@redhat.com>
Reviewed-by: Peter Xu <pet...@redhat.com>
Message-Id: <20180925081507.11873-2-w.bumil...@proxmox.com>
Signed-off-by: Markus Armbruster <arm...@redhat.com>
---
 monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor.c b/monitor.c
index 823b5a1099..66f149c1dc 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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.
-- 
2.17.2


Reply via email to