public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Amos Kong <akong@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 1/3] virtio: Correct error message of unavailable index
Date: Wed, 15 Jun 2011 23:30:32 +0300	[thread overview]
Message-ID: <20110615203032.GA8362@redhat.com> (raw)
In-Reply-To: <20110615142524.26726.13785.stgit@localhost6.localdomain6>

On Wed, Jun 15, 2011 at 10:25:24PM +0800, Amos Kong wrote:
> 'head' is an index of VirtQueueElement, it should less than vring.num
> 
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
>  hw/virtio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/virtio.c b/hw/virtio.c
> index 6e8814c..a3d0eee 100644
> --- a/hw/virtio.c
> +++ b/hw/virtio.c
> @@ -271,7 +271,7 @@ static unsigned int virtqueue_get_head(VirtQueue *vq, unsigned int idx)
>  
>      /* If their number is silly, that's a fatal mistake. */
>      if (head >= vq->vring.num) {
> -        error_report("Guest says index %u is available", head);
> +        error_report("Guest says index %u is unavailable", head);
>          exit(1);
>      }
>  

That does not seem right. So the message says that an illegal value
was made available - that is, put in the available ring.
The original message seems correct to me.



-- 
MST

  parent reply	other threads:[~2011-06-15 20:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15 14:25 [PATCH 1/3] virtio: Correct error message of unavailable index Amos Kong
2011-06-15 14:25 ` [PATCH 2/3] virtio: Strictly check queue_size when adding virtqueue Amos Kong
2011-06-15 20:36   ` Michael S. Tsirkin
2011-06-15 22:53     ` Amos Kong
2011-06-15 23:31       ` [Qemu-devel] " Anthony Liguori
2011-06-16  2:10         ` [PATCH v2] virtio: Define queue_size to unsigned Amos Kong
2011-06-15 14:25 ` [PATCH 3/3] virtio: Define max_nr_ports " Amos Kong
2011-06-15 20:39   ` Michael S. Tsirkin
2011-06-15 20:30 ` Michael S. Tsirkin [this message]
2011-06-16  1:59   ` [PATCH 1/3] virtio: Correct error message of unavailable index Amos Kong

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=20110615203032.GA8362@redhat.com \
    --to=mst@redhat.com \
    --cc=akong@redhat.com \
    --cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox