From owner-svn-src-all@freebsd.org Mon Dec 2 21:27:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC75A1B8C20; Mon, 2 Dec 2019 21:27:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47RdVK480gz4QSw; Mon, 2 Dec 2019 21:27:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 66917165B9; Mon, 2 Dec 2019 21:27:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f171.google.com with SMTP id d124so1183029qke.6; Mon, 02 Dec 2019 13:27:05 -0800 (PST) X-Gm-Message-State: APjAAAXOV/ah1irWfjCpCJ6/5AhWt8J4PeAcS3EFoFInw7nW0iw4DOu5 w1uYGkIUavhdCxKcnt93qrjt6rdryXRwLhDad7Y= X-Google-Smtp-Source: APXvYqyVHVhU9rJU62NH8srbd0NKmoBS9xvJMFD5TzQ0LMyE6udE+jDPaMo2gvkedsM7HJQHE41+OkKvbaozxbqhaIw= X-Received: by 2002:a37:4992:: with SMTP id w140mr1176631qka.493.1575322024987; Mon, 02 Dec 2019 13:27:04 -0800 (PST) MIME-Version: 1.0 References: <201912022051.xB2Kplot078056@repo.freebsd.org> <00084efce3baaad166ec9594e56bf43cd31ece0e.camel@freebsd.org> In-Reply-To: <00084efce3baaad166ec9594e56bf43cd31ece0e.camel@freebsd.org> From: Kyle Evans Date: Mon, 2 Dec 2019 15:26:53 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r355301 - head/usr.sbin/bhyve To: Ian Lepore Cc: Vincenzo Maffione , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Dec 2019 21:27:05 -0000 On Mon, Dec 2, 2019 at 3:14 PM Ian Lepore wrote: > > On Mon, 2019-12-02 at 20:51 +0000, Vincenzo Maffione wrote: > > Author: vmaffione > > Date: Mon Dec 2 20:51:46 2019 > > New Revision: 355301 > > URL: https://svnweb.freebsd.org/changeset/base/355301 > > > > Log: > > bhyve: uniform printf format string newlines > > > > Some of the printf statements only use LF to get a newline. > > However, a CR character is also required for the serial console to > > print debug logs in a nice way. > > Fix those code locations that only use LF, by adding a CR > > character. > > > > Reviewed by: markj, aleksandr.fedorov@itglobal.com > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D22552 > > > > Modified: > > head/usr.sbin/bhyve/audio.c > > head/usr.sbin/bhyve/hda_codec.c > > head/usr.sbin/bhyve/net_backends.c > > head/usr.sbin/bhyve/pci_ahci.c > > head/usr.sbin/bhyve/pci_e82545.c > > head/usr.sbin/bhyve/pci_hda.c > > head/usr.sbin/bhyve/pci_nvme.c > > head/usr.sbin/bhyve/pci_virtio_block.c > > head/usr.sbin/bhyve/pci_virtio_console.c > > head/usr.sbin/bhyve/pci_virtio_net.c > > head/usr.sbin/bhyve/pci_virtio_rnd.c > > head/usr.sbin/bhyve/pci_virtio_scsi.c > > head/usr.sbin/bhyve/pci_xhci.c > > head/usr.sbin/bhyve/rfb.c > > > > These changes seem wrong in a couple ways... > > - Lines are terminated by linefeeds in unix-like systems. If > linefeeds need to be translated to include carriage returns, that's the > responsibility of the terminal/line-discipline layer, not the source > strings being printed. > > - The sequence \n\r is very strange. For systems that do prefer > carriage returns, the \r always comes before the \n (or stands alone on > Mac systems), not after. > > I have a feeling that the root of this is something like "lots of > people use bhyve for Windows, so they use Windows apps to look at logs, > so the logs should be formatted for Windows." If that's the reasoning, > then why shouldn't we convert EVERY printf in the source base to > include carriage returns, just in case a windows user wants to browse a > log file? > Even Windows notepad is learning to cope with different EOL formats, for what it's worth.