diff mbox

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

Message ID 4AA80D99.3060604@redhat.com
State Superseded
Headers show

Commit Message

Gerd Hoffmann Sept. 9, 2009, 8:18 p.m. UTC
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

Comments

Jan Kiszka Sept. 9, 2009, 8:27 p.m. UTC | #1
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
diff mbox

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: