Received: from eggs.gnu.org ([2001:4830:134:3::10]:36457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnUPL-0005bz-Gm for qemu-devel@nongnu.org; Mon, 02 Dec 2013 09:23:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnUPF-0008Id-Bz for qemu-devel@nongnu.org; Mon, 02 Dec 2013 09:23:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnUPF-0008Gu-3v for qemu-devel@nongnu.org; Mon, 02 Dec 2013 09:23:25 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB2ENOBF031562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 2 Dec 2013 09:23:24 -0500 Date: Mon, 2 Dec 2013 15:23:22 +0100 From: Stefan Hajnoczi Message-ID: <20131202142322.GD28132@stefanha-thinkpad.redhat.com> References: <1384426458-24700-1-git-send-email-stefanha@redhat.com> <1384426458-24700-4-git-send-email-stefanha@redhat.com> <20131129100402.GD2887@dhcp-200-207.str.redhat.com> <20131129101341.GE2887@dhcp-200-207.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131129101341.GE2887@dhcp-200-207.str.redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/5] osdep: add qemu_set_tty_echo() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Luiz Capitulino On Fri, Nov 29, 2013 at 11:13:41AM +0100, Kevin Wolf wrote: > Am 29.11.2013 um 11:04 hat Kevin Wolf geschrieben: > > Am 14.11.2013 um 11:54 hat Stefan Hajnoczi geschrieben: > > > Using stdin with readline.c requires disabling echo and line buffering. > > > Add a portable wrapper to set the terminal attributes under Linux and > > > Windows. > > > > > > Signed-off-by: Stefan Hajnoczi > > > > There's already qemu_chr_fe_set_echo(). Can't we use that? Changing this > > setting outside the context of a chardev feels wrong anyway. > > Okay, I see, tools don't have chardevs, unfortunately. But can we avoid > duplication the other way round then, that is, let qemu-char.c use the > new functions? They don't seem to be exactly the same, so I'm not > completely sure if they are supposed to do different things or if they > are just buggy in different ways. I didn't see a nice way of doing that. The chardev approach is a little different - it tries to restore termios on shutdown by stashing it in a global variable.