Received: from eggs.gnu.org ([2001:4830:134:3::10]:56715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLWwP-0001kM-PV for qemu-devel@nongnu.org; Wed, 23 May 2018 12:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLWwL-00044E-P6 for qemu-devel@nongnu.org; Wed, 23 May 2018 12:48:45 -0400 Received: from s16.ehost.pl ([193.143.77.16]:50030) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fLWwL-00043b-Dk for qemu-devel@nongnu.org; Wed, 23 May 2018 12:48:41 -0400 References: <1526752108-21204-1-git-send-email-patryk@fala.ehost.pl> <87o9h7q53u.fsf@dusky.pond.sub.org> <187f5c5b-6ce3-a9d0-3431-4e0109292888@fala.ehost.pl> <87zi0qba1n.fsf@dusky.pond.sub.org> From: Patryk Olszewski Message-ID: Date: Wed, 23 May 2018 18:48:38 +0200 MIME-Version: 1.0 In-Reply-To: <87zi0qba1n.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [Qemu-devel] [PATCH] Remove unwanted crlf conversion in serial List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Peter Maydell , Paolo Bonzini , QEMU Developers , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= W dniu 23.05.2018 o 18:40, Markus Armbruster pisze: > Patryk writes: > >> W dniu 22.05.2018 o 15:07, Peter Maydell pisze: >>> On 22 May 2018 at 12:53, Markus Armbruster wrote: >>>> Patryk Olszewski writes: >>>> >>>>> Signed-off-by: Patryk Olszewski >>>>> --- >>>>> 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, >>>>> >>>>> 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 | ISIG); >>>>> tty.c_cflag &= ~(CSIZE | PARENB | PARODD | CRTSCTS | CSTOPB); >>>>> switch (data_bits) { >>>> This change may well make sense, but your commit message needs to >>>> explain *why*. >>>> >>>> For what it's worth, POSIX documents OPOST as "Post-process output", and >>>> the Linux manual page as "Enable implementation-defined output >>>> processing." >>> We've set OPOST on our terminals since forever, right back to >>> commit 0824d6fc674 in 2003. Not setting it seems like the right thing, >>> though, since we're generally otherwise setting the thing up to be a >>> raw mode tty (and if we're connecting this to a guest then raw seems >>> like what we want). >>> >>> I wonder whether connecting, say, the HMP monitor to a 'serial' >>> chardev (a) works now (b) ends up with stair-step output after >>> this change (c) is something we care about... >>> >>> thanks >>> -- PMM >>> >> This patch is here to help fix years old bug of lf being replaced with >> crlf in serial, which is super problematic in binary transmissions, >> making communication with devices through serial from guest almost >> impossible. >> >> Setting OPOST flag in c_oflag enables the output processing, in other >> words it makes any other flag set in c_oflag come into action. From my >> quick experiment on serial devices on Linux I found out that by default >> c_oflag has enabled ONLCR flag, which is the one responsible for the >> crlf conversion. Unsetting OPOST disables it. >> >> Bug reports related to that: >> >> 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 > Work that into your commit message, and you got a fine patch as far as > I'm concerned :) > First time contribution to such large project. Trying to learn how to properly work with mailing lists and such. If there's something I actually have to do now I'd like to get some pointers on how to do it. Thank you,