diff options
author | Heinz Graalfs <graalfs@linux.vnet.ibm.com> | 2013-05-28 15:03:55 +0200 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2013-07-30 16:10:59 +0200 |
commit | 2e14211476d70e3877180c19d72c0d96e23bdac5 (patch) | |
tree | 7ef1077941b1b8b3989c12e8d0b5e04ae10e833c /hw/char | |
parent | dbe49aea76a7805f05b33d548b2e543b51fa8bb1 (diff) |
s390/sclpconsole: handle char layer busy conditions
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>
Diffstat (limited to 'hw/char')
-rw-r--r-- | hw/char/sclpconsole.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c index bcc7893230..eb3988c2e4 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) |