[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/8] s390/sclpconsole: handle char layer busy condit
From: |
Christian Borntraeger |
Subject: |
[Qemu-devel] [PATCH 1/8] s390/sclpconsole: handle char layer busy conditions |
Date: |
Tue, 30 Jul 2013 16:23:08 +0200 |
From: Heinz Graalfs <address@hidden>
Handle busy conditions (errno=EAGAIN) in char layer by using
the new char layer in the sclp console.
Signed-off-by: Heinz Graalfs <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
---
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
- [Qemu-devel] [PULLv2 0/8] s390 patch queue, Christian Borntraeger, 2013/07/30
- [Qemu-devel] [PATCH 1/8] s390/sclpconsole: handle char layer busy conditions,
Christian Borntraeger <=
- [Qemu-devel] [PATCH 6/8] s390x/kvm: Reworked/fixed handling of cc3 in kvm_handle_css_inst(), Christian Borntraeger, 2013/07/30
- [Qemu-devel] [PATCH 3/8] s390x/ioinst: Throw addressing exception when memory_map failed, Christian Borntraeger, 2013/07/30
- [Qemu-devel] [PATCH 7/8] s390x/kvm: Remove redundant return code, Christian Borntraeger, 2013/07/30
- [Qemu-devel] [PATCH 8/8] s390: Implement dump-guest-memory support for target s390x, Christian Borntraeger, 2013/07/30
- [Qemu-devel] [PATCH 4/8] s390x/ioinst: Fixed alignment check in SCHM instruction, Christian Borntraeger, 2013/07/30
- [Qemu-devel] [PATCH 5/8] s390x/ioinst: Fixed priority of operand exceptions, Christian Borntraeger, 2013/07/30
- [Qemu-devel] [PATCH 2/8] s390x/ioinst: Add missing alignment checks for IO instructions, Christian Borntraeger, 2013/07/30