From nobody Wed May 15 06:28:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527105174001602.5523666542823; Wed, 23 May 2018 12:52:54 -0700 (PDT) Received: from localhost ([::1]:35188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLZoY-0005gL-1V for importer@patchew.org; Wed, 23 May 2018 15:52:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLZmc-0004pl-Sx for qemu-devel@nongnu.org; Wed, 23 May 2018 15:50:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLZmZ-0005ve-Rj for qemu-devel@nongnu.org; Wed, 23 May 2018 15:50:50 -0400 Received: from s16.ehost.pl ([193.143.77.16]:39396) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fLZmZ-0005uc-H1 for qemu-devel@nongnu.org; Wed, 23 May 2018 15:50:47 -0400 Received: from abxh176.neoplus.adsl.tpnet.pl ([83.9.1.176]:59780 helo=patryk-dom2.lan) by s16.ehost.pl with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1fLZmV-00010v-0s; Wed, 23 May 2018 21:50:43 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fala.ehost.pl; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=d6mdRGSWKumOwOMjarmpWVNmenOYj+TQJxMLYxqCACU=; b=EaBU9gHJ7ubE0zKhgS80Pb1fRh a9ZqZYpP6lkXTGNGDgUEWHABfFemyl56cBw8opd9iKzACrWUdRE2ZFJK3m7D9cF+6y9y66WQAOt97 TrYCp6lDIjEEmyJbqC5HQJDdm4I1zSSWfSODKxgEUJuE0YvX59FG46+6qF6+IZLMbemheyLis+gSt lzylwjOuSkAS/l5eH13jMV/EtzgmNxurXHdiXAZGpPFMaInUteL+xBkfutCoOc0MvosOvRdXVD8Ym +EN/aZ2DvGxUM2WmHd9mAM3LAqwaYlMAeve59HCmIgsCn6t8CYZfWOseLQzwnwO3BmcTaQW0PkkON rLPM59Ig==; From: Patryk Olszewski To: qemu-devel@nongnu.org Date: Wed, 23 May 2018 21:50:41 +0200 Message-Id: <1527105041-21013-1-git-send-email-patryk@fala.ehost.pl> X-Mailer: git-send-email 2.7.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - s16.ehost.pl X-AntiAbuse: Original Domain - nongnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fala.ehost.pl X-Get-Message-Sender-Via: s16.ehost.pl: authenticated_id: patryk@fala.ehost.pl X-Authenticated-Sender: s16.ehost.pl: patryk@fala.ehost.pl X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (barebone) [generic] [fuzzy] X-Received-From: 193.143.77.16 Subject: [Qemu-devel] [PATCH v2] Remove unwanted crlf conversion in serial X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Patryk Olszewski , Paolo Bonzini , thuth@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch fixes 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 Reviewed-by: Markus Armbruster Reviewed-by: Thomas Huth --- chardev/char-serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chardev/char-serial.c b/chardev/char-serial.c index feb52e5..ae548d2 100644 --- a/chardev/char-serial.c +++ b/chardev/char-serial.c @@ -139,7 +139,7 @@ static void tty_serial_init(int fd, int speed, =20 tty.c_iflag &=3D ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); - tty.c_oflag |=3D OPOST; + tty.c_oflag &=3D ~OPOST; tty.c_lflag &=3D ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG); tty.c_cflag &=3D ~(CSIZE | PARENB | PARODD | CRTSCTS | CSTOPB); switch (data_bits) { --=20 2.7.4