From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3nzi-0005iE-0Q for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:00:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3nzW-00038x-GP for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:00:13 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:46729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3nzW-00034Q-6P for qemu-devel@nongnu.org; Mon, 29 Jul 2013 10:00:02 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jul 2013 14:51:21 +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 BC8CA17D8063 for ; Mon, 29 Jul 2013 15:01:40 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6TDxjtf63438996 for ; Mon, 29 Jul 2013 13:59:45 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r6TDxusk020953 for ; Mon, 29 Jul 2013 07:59:56 -0600 From: Christian Borntraeger Date: Mon, 29 Jul 2013 16:00:11 +0200 Message-Id: <1375106418-22828-2-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1375106418-22828-1-git-send-email-borntraeger@de.ibm.com> References: <1375092324-23943-1-git-send-email-agraf@suse.de> <1375106418-22828-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 1/8] s390/sclpconsole: handle char layer busy conditions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Developers Cc: aliguori@us.ibm.com, Heinz Graalfs , Alexander Graf , Christian Borntraeger , Jens Freimann , cornelia.huck@de.ibm.com 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) -- 1.8.3.1