aboutsummaryrefslogtreecommitdiff
path: root/chardev/char-stdio.c
diff options
context:
space:
mode:
authorPatryk Olszewski <patryk@fala.ehost.pl>2018-05-23 21:50:41 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-06-01 15:14:31 +0200
commit12fb0ac0575df83cec72ec5ede293561ee634cc9 (patch)
tree2542179d2638d8f66614f038f4efe6fde6b4440e /chardev/char-stdio.c
parentff46d9d4d6dda7716c534a300087f447c285ad2b (diff)
char: Remove unwanted crlf conversion
This patch fixes a bug in serial that made it almost impossible for guest to communicate with devices through host's serial. OPOST flag in c_oflag enables output processing letting other flags in c_oflag take effect. Usually in c_oflag ONLCR flag is also set, which causes crlf to be sent in place of lf. This breaks binary transmissions. Unsetting OPOST flag turns off any output processing which fixes the bug. Bug reports related: https://bugs.launchpad.net/qemu/+bug/1772086 https://bugs.launchpad.net/qemu/+bug/1407813 https://bugs.launchpad.net/qemu/+bug/1715296 also https://lists.nongnu.org/archive/html/qemu-devel/2006-06/msg00196.html Signed-off-by: Patryk Olszewski <patryk@fala.ehost.pl> Message-Id: <1527105041-21013-1-git-send-email-patryk@fala.ehost.pl> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'chardev/char-stdio.c')
-rw-r--r--chardev/char-stdio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chardev/char-stdio.c b/chardev/char-stdio.c
index 96375f2ab8..d83e60e787 100644
--- a/chardev/char-stdio.c
+++ b/chardev/char-stdio.c
@@ -59,7 +59,7 @@ static void qemu_chr_set_echo_stdio(Chardev *chr, bool echo)
if (!echo) {
tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP
| INLCR | IGNCR | ICRNL | IXON);
- tty.c_oflag |= OPOST;
+ tty.c_oflag &= ~OPOST;
tty.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN);
tty.c_cflag &= ~(CSIZE | PARENB);
tty.c_cflag |= CS8;