qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu list <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH v2] virtio-serial: Print out reason for aborting before calling abort()
Date: Fri, 25 Mar 2011 15:01:35 +0530	[thread overview]
Message-ID: <20110325093135.GA29172@amit-x200.redhat.com> (raw)
In-Reply-To: <m3k4fneepn.fsf@neno.mitica>

On (Fri) 25 Mar 2011 [10:23:16], Juan Quintela wrote:
> Amit Shah <amit.shah@redhat.com> 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 |    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 <quintela@redhat.com>
> 
> 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
> :-(

Yes :-(

BTW I'm working on more patches here: first step is to have
implementations of have_data() take the right call in other error
conditions (e.g. chardev closed would give -EPIPE, so those type of
things should be handled there sanely.)

		Amit

      reply	other threads:[~2011-03-25  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25  6:39 [Qemu-devel] [PATCH v2] virtio-serial: Print out reason for aborting before calling abort() Amit Shah
2011-03-25  9:23 ` [Qemu-devel] " Juan Quintela
2011-03-25  9:31   ` Amit Shah [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110325093135.GA29172@amit-x200.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).