chardev/char-win-stdio: Pass Ctrl+C to guest with a multiplexed monitor
commit06639f8ff53d1dbfa709377499e6c30eca9c3c9a
authorBin Meng <bin.meng@windriver.com>
Tue, 25 Oct 2022 14:10:15 +0000 (25 22:10 +0800)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 21 Nov 2022 07:30:11 +0000 (21 11:30 +0400)
treef3c1bb67b21259a2daeab05b3a8a9a6ca271db29
parenta082fab9d259473a9d5d53307cf83b1223301181
chardev/char-win-stdio: Pass Ctrl+C to guest with a multiplexed monitor

At present when pressing Ctrl+C from a guest running on QEMU Windows
with a multiplexed monitor, e.g.: -serial mon:stdio, QEMU executable
just exits. This behavior is inconsistent with the Linux version.

Such behavior is caused by unconditionally setting the input mode
ENABLE_PROCESSED_INPUT for a console's input buffer. Fix this by
testing whether the chardev is allowed to do so.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20221025141015.612291-1-bin.meng@windriver.com>
chardev/char-win-stdio.c