From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51944 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q30Ra-0007Lt-FK for qemu-devel@nongnu.org; Fri, 25 Mar 2011 02:24:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q30RZ-0002Xp-2h for qemu-devel@nongnu.org; Fri, 25 Mar 2011 02:24:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q30RY-0002XW-NA for qemu-devel@nongnu.org; Fri, 25 Mar 2011 02:24:21 -0400 From: Amit Shah Date: Fri, 25 Mar 2011 11:54:02 +0530 Message-Id: Subject: [Qemu-devel] [PATCH] virtio-serial: Print out reason for aborting before calling abort() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Amit Shah , qemu list , Juan Quintela When a port returns an error for not consuming data, we can only handle the -EAGAIN error type. Any other error isn't handled. Print out a message indicating this and the error returned. Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index a82fbe9..0e4ac81 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -155,6 +155,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq, buf_size); if (ret < 0 && ret != -EAGAIN) { /* We don't handle any other type of errors here */ + error_report("%s: unexpected return %zd, aborting.\n", ret); abort(); } if (ret == -EAGAIN || (ret >= 0 && ret < buf_size)) { -- 1.7.4