From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xha1K-0002s5-Uy for qemu-devel@nongnu.org; Fri, 24 Oct 2014 04:14:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xha1B-000506-PM for qemu-devel@nongnu.org; Fri, 24 Oct 2014 04:14:50 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:36130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xha1B-0004zz-GG for qemu-devel@nongnu.org; Fri, 24 Oct 2014 04:14:41 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Oct 2014 09:14:40 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id A52A217D8024 for ; Fri, 24 Oct 2014 09:14:38 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s9O8EbHj16777554 for ; Fri, 24 Oct 2014 08:14:37 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s9O8EZls029156 for ; Fri, 24 Oct 2014 02:14:36 -0600 From: Heinz Graalfs Date: Fri, 24 Oct 2014 10:13:46 +0200 Message-Id: <1414138427-60643-3-git-send-email-graalfs@linux.vnet.ibm.com> In-Reply-To: <1414138427-60643-1-git-send-email-graalfs@linux.vnet.ibm.com> References: <1414138427-60643-1-git-send-email-graalfs@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC 2/3] s390x: Fix hanging SCLP line mode console List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: cornelia.huck@de.ibm.com, pbonzini@redhat.com, Heinz Graalfs , borntraeger@de.ibm.com Exploit the new can_read timeout infrastructure in order to avoid hangs when no further activity happens on the main thread. Signed-off-by: Heinz Graalfs --- hw/char/sclpconsole-lm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index 80dd0a9..3575ef2 100644 --- a/hw/char/sclpconsole-lm.c +++ b/hw/char/sclpconsole-lm.c @@ -60,11 +60,11 @@ static int chr_can_read(void *opaque) SCLPConsoleLM *scon = opaque; if (scon->event.event_pending) { - return 0; + return -EAGAIN; } else if (SIZE_CONSOLE_BUFFER - scon->length) { return 1; } - return 0; + return -EAGAIN; } static void chr_read(void *opaque, const uint8_t *buf, int size) -- 1.8.3.1