qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] cadence_uart: Handle backend tx errors
@ 2013-06-18 10:14 edgar.iglesias
  0 siblings, 0 replies; only message in thread
From: edgar.iglesias @ 2013-06-18 10:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.crosthwaite

From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
---
 hw/char/cadence_uart.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index c2a7834..2219a0e 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -298,7 +298,12 @@ static void uart_write_tx_fifo(UartState *s, const uint8_t *buf, int size)
     }
 
     while (size) {
-        size -= qemu_chr_fe_write(s->chr, buf, size);
+        int r;
+        r = qemu_chr_fe_write_all(s->chr, buf, size);
+        if (r < 0) {
+            break;
+        }
+        size -= r;
     }
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-18 10:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18 10:14 [Qemu-devel] [PATCH] cadence_uart: Handle backend tx errors edgar.iglesias

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).