Patchwork Re: [PATCH 22/23] monitor: fix muxing

login
register
mail settings
Submitter Gerd Hoffmann
Date Sept. 9, 2009, 8:18 p.m.
Message ID <4AA80D99.3060604@redhat.com>
Download mbox | patch
Permalink /patch/33227/
State Superseded
Headers show

Comments

Gerd Hoffmann - Sept. 9, 2009, 8:18 p.m.
On 09/09/09 21:51, Jan Kiszka wrote:
> Gerd Hoffmann wrote:
>> make the mux driver send mux_in and mux_out events when switching
>> focus while hooking up more handlers.
>>
>> stop using CharDriverState->focus in monitor.c, track state using
>> the mux events instead.  This also removes the implicit assumtion
>> that a muxed monitor allways has mux channel 0.
>
> Nice patch in the right direction, but it comes with a regression: When
> you enable the monitor on mux'ed stdio via CTRL-A C, you don't get a
> prompt until pressing some key.

Incremental fix attached.

> Please add braces at this chance.

Will do.

cheers,
   Gerd
Jan Kiszka - Sept. 9, 2009, 8:27 p.m.
Gerd Hoffmann wrote:
> On 09/09/09 21:51, Jan Kiszka wrote:
>> Gerd Hoffmann wrote:
>>> make the mux driver send mux_in and mux_out events when switching
>>> focus while hooking up more handlers.
>>>
>>> stop using CharDriverState->focus in monitor.c, track state using
>>> the mux events instead.  This also removes the implicit assumtion
>>> that a muxed monitor allways has mux channel 0.
>>
>> Nice patch in the right direction, but it comes with a regression: When
>> you enable the monitor on mux'ed stdio via CTRL-A C, you don't get a
>> prompt until pressing some key.
> 
> Incremental fix attached.

Works, perfect.

> 
>> Please add braces at this chance.
> 
> Will do.

Fine. And please also reorder that "if (-1 != chr->focus)" :)

Jan

Patch

diff --git a/monitor.c b/monitor.c
index edf48f3..476eab5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3113,6 +3113,7 @@  static void monitor_event(void *opaque, int event)
 
     switch (event) {
     case CHR_EVENT_MUX_IN:
+        mon->mux_out = 0;
         if (mon->reset_seen) {
             readline_restart(mon->rs);
             monitor_resume(mon);
@@ -3120,7 +3121,6 @@  static void monitor_event(void *opaque, int event)
         } else {
             mon->suspend_cnt = 0;
         }
-        mon->mux_out = 0;
         break;
 
     case CHR_EVENT_MUX_OUT: