monitor: accept input on resume
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 17 Aug 2018 17:37:52 +0000 (19:37 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 28 Aug 2018 19:11:06 +0000 (21:11 +0200)
A chardev may stop trying to write if the associated can_read()
callback returned 0. This happens when the monitor is suspended.
The frontend is supposed to call qemu_chr_fe_accept_input() when it is
ready to accept data again.

An issue was observed with a spice port: pending commands may be
delayed, as the chardev is not flushed. Most chardev don't use the
accept_input() callback, and instead check regularly if they can
write. The ones that do use it are braille, mux, msmouse,
spice (abstract), spicevmc, spiceport, wctablet.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180817173752.19136-1-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
monitor.c

index c0497766032241eeb806b30ec475234ea3da47f7..c1add2ce09b397a0e90fa71b36dc402717b08b5b 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -4411,6 +4411,7 @@ void monitor_resume(Monitor *mon)
             assert(mon->rs);
             readline_show_prompt(mon->rs);
         }
+        qemu_chr_fe_accept_input(&mon->chr);
     }
     trace_monitor_suspend(mon, -1);
 }