All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] virtio: abort on fatal error instead of just exiting
Date: Wed, 29 Jun 2016 14:49:59 +0200	[thread overview]
Message-ID: <87vb0sw45k.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1467102269-11112-1-git-send-email-imammedo@redhat.com> (Igor Mammedov's message of "Tue, 28 Jun 2016 10:24:29 +0200")

Igor Mammedov <imammedo@redhat.com> writes:

> replace mainly useless exit(1) on fatal error path with
> abort(), so that it would be possible to generate core
> dump, that could be used to analyse cause of problem.
>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  hw/virtio/virtio.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 7ed06ea..9d3ac72 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -315,7 +315,7 @@ static int virtqueue_num_heads(VirtQueue *vq, unsigned int idx)
>      if (num_heads > vq->vring.num) {
>          error_report("Guest moved used index from %u to %u",
>                       idx, vq->shadow_avail_idx);
> -        exit(1);
> +        abort();

What's wrong with a simple assert(num_heads <= vq->vring.num)?

>      }
>      /* On success, callers read a descriptor at vq->last_avail_idx.
>       * Make sure descriptor read does not bypass avail index read. */
[...]

  parent reply	other threads:[~2016-06-29 12:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28  8:24 [Qemu-devel] [PATCH] virtio: abort on fatal error instead of just exiting Igor Mammedov
2016-06-28  9:05 ` Greg Kurz
2016-06-28 10:42 ` Cornelia Huck
2016-06-29 12:49 ` Markus Armbruster [this message]
2016-06-29 16:36   ` Igor Mammedov
2016-06-30  5:12     ` Markus Armbruster
2016-06-30  6:55       ` Igor Mammedov
2016-07-27 18:13 ` Michael S. Tsirkin

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=87vb0sw45k.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.