From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: "Cornelia Huck" <cornelia.huck@de.ibm.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
"Heinz Graalfs" <graalfs@linux.vnet.ibm.com>,
"Andreas Färber" <afaerber@suse.de>,
qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 1/7] s390/sclpconsole: handle char layer busy conditions
Date: Mon, 15 Jul 2013 21:57:39 +0200 [thread overview]
Message-ID: <1373918265-20172-2-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1373918265-20172-1-git-send-email-borntraeger@de.ibm.com>
From: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Handle busy conditions (errno=EAGAIN) in char layer by using
the new char layer in the sclp console.
Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
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.1.4
next prev parent reply other threads:[~2013-07-15 19:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 19:57 [Qemu-devel] [PATCH 0/7] s390 fixes Christian Borntraeger
2013-07-15 19:57 ` Christian Borntraeger [this message]
2013-07-15 19:57 ` [Qemu-devel] [PATCH 2/7] s390x/ioinst: Add missing alignment checks for IO instructions Christian Borntraeger
2013-07-15 19:57 ` [Qemu-devel] [PATCH 3/7] s390x/ioinst: Throw addressing exception when memory_map failed Christian Borntraeger
2013-07-15 19:57 ` [Qemu-devel] [PATCH 4/7] s390x/ioinst: Fixed alignment check in SCHM instruction Christian Borntraeger
2013-07-15 19:57 ` [Qemu-devel] [PATCH 5/7] s390x/ioinst: Fixed priority of operand exceptions Christian Borntraeger
2013-07-15 19:57 ` [Qemu-devel] [PATCH 6/7] s390x/kvm: Reworked/fixed handling of cc3 in kvm_handle_css_inst() Christian Borntraeger
2013-07-15 19:57 ` [Qemu-devel] [PATCH 7/7] s390x/kvm: Remove redundant return code Christian Borntraeger
2013-07-23 11:48 ` [Qemu-devel] [PATCH 0/7] s390 fixes Christian Borntraeger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373918265-20172-2-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=cornelia.huck@de.ibm.com \
--cc=graalfs@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).