Skip to content

Commit

Permalink
monitor: accept input on resume
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
elmarco authored and Markus Armbruster committed Aug 28, 2018
1 parent 3d7a1c4 commit 8af6bb1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions monitor.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8af6bb1

Please sign in to comment.