summaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-09-10 10:58:54 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:19:49 -0500
commita7aec5da4d3d20e9c505f59487da56fce0a08f3c (patch)
treeb84e4583842db8f8902a6f50717b4773b8f362fe /qemu-char.c
parent06113719be29c6f8e3f93f98c4ebe3318e889c0c (diff)
downloadqemu-a7aec5da4d3d20e9c505f59487da56fce0a08f3c.tar.gz
monitor: fix muxing
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. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/qemu-char.c b/qemu-char.c
index ce2799e205..4a5d03b744 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -456,8 +456,12 @@ static void mux_chr_update_read_handler(CharDriverState *chr)
qemu_chr_add_handlers(d->drv, mux_chr_can_read, mux_chr_read,
mux_chr_event, chr);
}
+ if (chr->focus != -1) {
+ mux_chr_send_event(d, chr->focus, CHR_EVENT_MUX_OUT);
+ }
chr->focus = d->mux_cnt;
d->mux_cnt++;
+ mux_chr_send_event(d, chr->focus, CHR_EVENT_MUX_IN);
}
static CharDriverState *qemu_chr_open_mux(CharDriverState *drv)