diff mbox

virtio-serial: Print out reason for aborting before calling abort()

Message ID fbadb7dd4f75d14420ffa36b22df681769aedf84.1301034241.git.amit.shah@redhat.com
State New
Headers show

Commit Message

Amit Shah March 25, 2011, 6:24 a.m. UTC
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 <amit.shah@redhat.com>
---
 hw/virtio-serial-bus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Amit Shah March 25, 2011, 6:38 a.m. UTC | #1
On (Fri) 25 Mar 2011 [11:54:02], Amit Shah wrote:
> 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 <amit.shah@redhat.com>
> ---
>  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);

Sorry, re-sending.

		Amit
diff mbox

Patch

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