From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTWMj-0006SE-FT for qemu-devel@nongnu.org; Mon, 15 Sep 2014 09:30:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTWMV-0002DI-UN for qemu-devel@nongnu.org; Mon, 15 Sep 2014 09:30:49 -0400 Message-ID: <1410787775.30598.11.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Mon, 15 Sep 2014 15:29:35 +0200 In-Reply-To: <5416E22B.9060002@msgid.tls.msk.ru> References: <1410261588-8360-1-git-send-email-john.liuli@huawei.com> <5416E094.9070500@msgid.tls.msk.ru> <5416E22B.9060002@msgid.tls.msk.ru> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] qemu-char: fix terminal crash when using "-monitor stdio -nographic" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: qemu-trivial@nongnu.org, "john.liuli" , peter.huangpeng@huawei.com, armbru@redhat.com, qemu-devel@nongnu.org On Mo, 2014-09-15 at 16:57 +0400, Michael Tokarev wrote: > 15.09.2014 16:50, Michael Tokarev =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > 09.09.2014 15:19, john.liuli wrote: > >> From: Li Liu > >> > >> Eeay to reproduce, just try "qemu -monitor stdio -nographic" > >> and type "quit", then the terminal will be crashed. > >> > >> There are two pathes try to call tcgetattr of stdio in vl.c: > >=20 > > This looks reasonable. Except of one thing -- how about renaming > > stdio_is_ready to stdio_in_use? (I can do that when applying, no > > need to resend anythnig). Because, well, stdio_is_ready is not > > obvious at all, at least to me... :) >=20 > And oh, the commit comment -- it is not 'terminal crash', it is > 'terminal misbehavor' or something like that. Terminal does not > crash, it just does not have proper settings after qemu exits. For the record: The 'reset' utility does a full terminal reset and restores sane settings. So usually you can recover from any terminal f*ckup like this by first hitting Ctrl-C [1], then type "reset" [2], then hit Enter. HTH, Gerd [1] To cancel anything which might be at your shell prompt. [2] Possibly blindly in case echo happens to be turned off.