From patchwork Tue Jun 18 10:14:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 252221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4945F2C00A0 for ; Tue, 18 Jun 2013 20:17:38 +1000 (EST) Received: from localhost ([::1]:57598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uosyl-0004l0-Pe for incoming@patchwork.ozlabs.org; Tue, 18 Jun 2013 06:17:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UosyR-0004kv-TC for qemu-devel@nongnu.org; Tue, 18 Jun 2013 06:17:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UosyN-0000EL-B9 for qemu-devel@nongnu.org; Tue, 18 Jun 2013 06:17:15 -0400 Received: from mail-ea0-x236.google.com ([2a00:1450:4013:c01::236]:65459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UosyN-0000EH-0w for qemu-devel@nongnu.org; Tue, 18 Jun 2013 06:17:11 -0400 Received: by mail-ea0-f182.google.com with SMTP id d10so2448350eaj.41 for ; Tue, 18 Jun 2013 03:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=KIfiepzsCVie4sZdbo0O/HrPiI9H8bOczm2+CVYj4Y0=; b=iBdJK9gLIand/8a5OxhQh/maE9IpoM14lKddpMjfw97q28DUiS1SJW+ScbUyswuYNe T/la12TyU9ztte3ROGW6+j6fLq56ZULc4mXev+yH5uq2fdGXQJmK2RIl0AnbC2UzB8nT uqLG1Kt3oFeVdVCmqHqoLWRrFLjtnqIP+pPYJ46aKGqvQcSdunJzviGmCsXuA+vm0Yz3 43VG9BGiEc/98E+RAVJ4UW6MPXk1bupwzmI44PmELls1uKPNyVfYG8ZmAK6qaCl/H843 5NPHqn9D1vLUavYH/BMBNuGPKqnO9RVGIKqrdB8FcPQprI24+HL2lEFDLb/6j8FkxQRG ut4g== X-Received: by 10.15.33.13 with SMTP id b13mr21917208eev.0.1371550630302; Tue, 18 Jun 2013 03:17:10 -0700 (PDT) Received: from localhost (h59ec325f.selukar.dyn.perspektivbredband.net. [89.236.50.95]) by mx.google.com with ESMTPSA id i2sm719114eeu.4.2013.06.18.03.17.07 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Jun 2013 03:17:09 -0700 (PDT) From: edgar.iglesias@gmail.com To: qemu-devel@nongnu.org Date: Tue, 18 Jun 2013 12:14:11 +0200 Message-Id: <1371550451-28150-1-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::236 Cc: peter.crosthwaite@xilinx.com Subject: [Qemu-devel] [PATCH] cadence_uart: Handle backend tx errors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias --- 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; } }