[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 31/53] mux: fix ctrl-a b again
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 31/53] mux: fix ctrl-a b again |
Date: |
Thu, 31 May 2018 19:12:31 +0200 |
From: Marc-André Lureau <address@hidden>
Commit fb5e19d2e1472e96d72d5e4d89c20033f8ab345c originally fixed the
regression, but was inadvertently broken again in merge commit
2d6752d38d8acda.
Fixes:
https://bugs.launchpad.net/qemu/+bug/1654137
Cc: address@hidden
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
chardev/char-mux.c | 1 +
tests/test-char.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/chardev/char-mux.c b/chardev/char-mux.c
index 1b925c8dec..6055e76293 100644
--- a/chardev/char-mux.c
+++ b/chardev/char-mux.c
@@ -304,6 +304,7 @@ void mux_set_focus(Chardev *chr, int focus)
}
d->focus = focus;
+ chr->be = d->backends[focus];
mux_chr_send_event(d, d->focus, CHR_EVENT_MUX_IN);
}
diff --git a/tests/test-char.c b/tests/test-char.c
index 1880d36783..5905d31441 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -214,6 +214,10 @@ static void char_mux_test(void)
g_assert_cmpint(h2.last_event, ==, -1);
/* switch focus */
+ qemu_chr_be_write(base, (void *)"\1b", 2);
+ g_assert_cmpint(h1.last_event, ==, 42);
+ g_assert_cmpint(h2.last_event, ==, CHR_EVENT_BREAK);
+
qemu_chr_be_write(base, (void *)"\1c", 2);
g_assert_cmpint(h1.last_event, ==, CHR_EVENT_MUX_IN);
g_assert_cmpint(h2.last_event, ==, CHR_EVENT_MUX_OUT);
@@ -227,6 +231,10 @@ static void char_mux_test(void)
g_assert_cmpstr(h1.read_buf, ==, "hello");
h1.read_count = 0;
+ qemu_chr_be_write(base, (void *)"\1b", 2);
+ g_assert_cmpint(h1.last_event, ==, CHR_EVENT_BREAK);
+ g_assert_cmpint(h2.last_event, ==, CHR_EVENT_MUX_OUT);
+
/* remove first handler */
qemu_chr_fe_set_handlers(&chr_be1, NULL, NULL, NULL, NULL,
NULL, NULL, true);
--
2.17.0
- [Qemu-devel] [PULL 21/53] hw/i386/pc: Remove unused include, (continued)
- [Qemu-devel] [PULL 21/53] hw/i386/pc: Remove unused include, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 20/53] hw/hppa: Remove unused include, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 23/53] hw: Clean "hw/devices.h" includes, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 24/53] qom: Document qom/device-list-properties implementation specific, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 25/53] qom: support orphan objects in object_get_canonical_path, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 26/53] virtio: free MemoryRegionCache when initialization fails, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 27/53] memory.h: Fix typo in documentation comment, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 28/53] memory: get rid of memory_region_init_reservation, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 30/53] hw/isa/superio: Fix inconsistent use of Chardev->be, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 31/53] mux: fix ctrl-a b again,
Paolo Bonzini <=
- [Qemu-devel] [PULL 32/53] memfd: Avoid Coverity warning about integer overflow, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 33/53] exec.c: Initialize sa_flags passed to sigaction(), Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 29/53] memory: delete struct AddressSpaceOps, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 36/53] qemu-options: Mark the non-functional -clock option as deprecated, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 35/53] WHPX: fix some compiler warnings, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 37/53] tcg: remove softfloat from --disable-tcg builds, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 34/53] WHPX: dynamically load WHP libraries, Paolo Bonzini, 2018/05/31
- [Qemu-devel] [PULL 39/53] ipmi: Use proper struct reference for KCS vmstate, Paolo Bonzini, 2018/05/31