From patchwork Mon Jul 15 19:57:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 259255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2E1172C017A for ; Tue, 16 Jul 2013 05:58:07 +1000 (EST) Received: from localhost ([::1]:43245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyouJ-0007va-W0 for incoming@patchwork.ozlabs.org; Mon, 15 Jul 2013 15:58:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyotl-0007uL-Va for qemu-devel@nongnu.org; Mon, 15 Jul 2013 15:57:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uyotk-0006Fh-7g for qemu-devel@nongnu.org; Mon, 15 Jul 2013 15:57:29 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:43541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyotj-0006FA-Tq for qemu-devel@nongnu.org; Mon, 15 Jul 2013 15:57:28 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Jul 2013 20:52:02 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 15 Jul 2013 20:52:02 +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 5CBA017D8058 for ; Mon, 15 Jul 2013 20:59:01 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6FJvD1d55115796 for ; Mon, 15 Jul 2013 19:57:13 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r6FJvND1031993 for ; Mon, 15 Jul 2013 15:57:24 -0400 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r6FJvNx4031988; Mon, 15 Jul 2013 15:57:23 -0400 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 96B921224439; Mon, 15 Jul 2013 21:57:23 +0200 (CEST) From: Christian Borntraeger To: Alexander Graf Date: Mon, 15 Jul 2013 21:57:39 +0200 Message-Id: <1373918265-20172-2-git-send-email-borntraeger@de.ibm.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1373918265-20172-1-git-send-email-borntraeger@de.ibm.com> References: <1373918265-20172-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13071519-8372-0000-0000-000006955846 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.108 Cc: Cornelia Huck , Christian Borntraeger , Heinz Graalfs , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel Subject: [Qemu-devel] [PATCH 1/7] s390/sclpconsole: handle char layer busy conditions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Heinz Graalfs Handle busy conditions (errno=EAGAIN) in char layer by using the new char layer in the sclp console. Signed-off-by: Heinz Graalfs Signed-off-by: Christian Borntraeger --- hw/char/sclpconsole.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index bcc7893..eb3988c 100644 --- a/hw/char/sclpconsole.c +++ b/hw/char/sclpconsole.c @@ -184,8 +184,6 @@ static int read_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr, static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf, size_t len) { - ssize_t ret = 0; - const uint8_t *iov_offset; SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event); if (!scon->chr) { @@ -193,21 +191,7 @@ static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf, return len; } - iov_offset = buf; - while (len > 0) { - ret = qemu_chr_fe_write(scon->chr, buf, len); - if (ret == 0) { - /* a pty doesn't seem to be connected - no error */ - len = 0; - } else if (ret == -EAGAIN || (ret > 0 && ret < len)) { - len -= ret; - iov_offset += ret; - } else { - len = 0; - } - } - - return ret; + return qemu_chr_fe_write_all(scon->chr, buf, len); } static int write_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr)