From owner-svn-src-all@freebsd.org Tue Dec 3 00:49:11 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 3D2E31BDE58 for ; Tue, 3 Dec 2019 00:49:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47RjzV5rL3z4c07 for ; Tue, 3 Dec 2019 00:49:10 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1575334149; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=dTJ1kUAQfbTcPzkRyfptJ5MCEI0zJSmCgfnrhHtKQrrpyZqeCFXTkKC77zVVSBDQlMxSNELHnpO6D P/D4Kv5gJ+zYWq47fkge8v8o7FKz6iuH7S33MN4zYnf2Xjif2lqy6FWdXwOc2RCjJuRXjHeryFDMwv ZeR3U5xAIPGXhbnY2JwGsGceZQFrC2a8SHVIgRm+lOsC29XXP/LeUejcXPIU2GGNbAzh6rHe2El8/4 i+FO1JzcWip1TQXf99H6o6g6N6N7BR7ENP9qcFPimjfQeHKjNKxwTmZTFtVtNlBUFDCyshckKhvRKf 9B5jHggXsnDngsCMglwqRDvAVh86qnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=DJJFzSO60gsDdB+Wb0xTyLgzHNPqAL/IEzS0R3qNKYU=; b=Q1rOQWKW0UUYetEypj0GWhDytvy+M9LyaUZXNQqi9T2nO/ZhYT8e+AHBF4ehAShMMEAuNNXrDGu5F Tt7dpeKvD5bKGuh2s4ilpWyAlxKGAN7BVllrpI+roy+vV7UAsRd4JFrVuzX8ZROdMcuvXR4OTg7wPC VhofQxXtw8+elFwk31ewg5rnXFWoHceNpcpug9pHZf0NQ+hOf1/+DMn+NX4jEVoWYBqWX+InyBypHa RAF5Xlj2QPLZ6OuWzzAZ9aXahGAfiyM9elimhgl162PW3tTEIIYXsRb1T77NzuH37oNOBqnD1HEk3E 7nsL7bzbjDYn1U5kw/AtLL1U9MBCQhQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=DJJFzSO60gsDdB+Wb0xTyLgzHNPqAL/IEzS0R3qNKYU=; b=PwfuEpKO1Mf9NQC1vv1quE4RObM020ZlSC9Is+Syf4olC2rBM+DtfHrhnx+gE6eotMPmbciAe11zP gVgOz75GItnRvnfhYEGkHXSRzT0FOR+xk0m8m4a7DBNVglTAJHhXR6r+NL9eROlDKKipR3zPE3Vam2 vbHfjj82KQJiRT1UeHfjP8saOQzWVhdPxZqRz8noMB0L9tUo/ENUuoC7kC+oOB7B9/Lu8E4TkQgBIh FmsYZR/IXSh3nSBaRwjQTX1kYVNNQ9CIk3TUYnOouoMkxFfX6vlN6g7I6pbL5do8WZ5/PJcBhV1t4M N3gmS9uxznpaqQpOza5jXsEre0MbDwA== X-MHO-RoutePath: aGlwcGll X-MHO-User: b5ceefa7-1566-11ea-829e-79a40d15cccd X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id b5ceefa7-1566-11ea-829e-79a40d15cccd; Tue, 03 Dec 2019 00:49:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id xB30n6DB097695; Mon, 2 Dec 2019 17:49:06 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <7783d9967146e4293c27b42f0b65882364e3c1da.camel@freebsd.org> Subject: Re: svn commit: r355301 - head/usr.sbin/bhyve From: Ian Lepore To: Vincenzo Maffione Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 02 Dec 2019 17:49:06 -0700 In-Reply-To: References: <201912022051.xB2Kplot078056@repo.freebsd.org> <00084efce3baaad166ec9594e56bf43cd31ece0e.camel@freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47RjzV5rL3z4c07 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.88 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-0.93)[-0.927,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] 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: Tue, 03 Dec 2019 00:49:11 -0000 On Mon, 2019-12-02 at 22:35 +0100, Vincenzo Maffione wrote: > Il giorno lun 2 dic 2019 alle ore 22:14 Ian Lepore > ha > scritto: > > > 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. > > > > That's a good point. The need for carriage returns shows up when using the > vmrun.sh script on a FreeBSD host, which ends up calling /usr/bin/bhyve. > I must admit I don't know enough about the terminals and ldisc to know how > to change the current behaviour and fix this specific issue. > Any suggestions and pointer would be very welcome. > > > Thanks, > Vincenzo > In that case, I wonder if this is the right fix: Index: sys/dev/bvm/bvm_console.c =================================================================== --- sys/dev/bvm/bvm_console.c (revision 355274) +++ sys/dev/bvm/bvm_console.c (working copy) @@ -223,6 +223,10 @@ static void bvm_cnputc(struct consdev *cp, int c) { + if (c == '\n') { + bvm_wcons('\r'); + } bvm_wcons(c); } That's how other console drivers seem to handle it. -- Ian