Skip to contentSkip to conversation

monitor: accept input on resume

PATCH Applied Marc-André Lureau 2 participants 2 messages Aug 17, 2018 – Aug 27, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 monitor: accept input on resume

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.

---
 monitor.c | 1 +
 1 file changed, 1 insertion(+)
monitor.c +1 -0
index a1999e396c..33823b035a 100644
@@ -4407,6 +4407,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);
 }
Signature · 1 line
2.18.0.547.g1d89318c48
#1 lore raw
Quoted 22 lines · Marc-André Lureau

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.

---
 monitor.c | 1 +
 1 file changed, 1 insertion(+)
monitor.c +0 -0
index a1999e396c..33823b035a 100644

monitor.c void monitor_resume(Monitor *mon) · line 4413

Quoted 7 lines
monitor.c +1 -0
@@ -4407,6 +4407,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);
 }

Queued. Thanks!