qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH v2] virtio-serial: Print out reason for aborting


From: Juan Quintela
Subject: [Qemu-devel] Re: [PATCH v2] virtio-serial: Print out reason for aborting before calling abort()
Date: Fri, 25 Mar 2011 10:23:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Amit Shah <address@hidden> 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 <address@hidden>
> ---
>  hw/virtio-serial-bus.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
> index a82fbe9..8b715b2 100644
> --- a/hw/virtio-serial-bus.c
> +++ b/hw/virtio-serial-bus.c
> @@ -155,6 +155,8 @@ 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",
> +                             __func__, ret);
>                  abort();
>              }
>              if (ret == -EAGAIN || (ret >= 0 && ret < buf_size)) {

Reviewed-by: Juan Quintela <address@hidden>

I agree that change is a step in the right direction.  But I don't think
the "abort" way of handling errors.  Not that this can be improved
without changing all virtual queues functions to allow for return codes
:-(




reply via email to

[Prev in Thread] Current Thread [Next in Thread]