From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH 1/3] virtio: Correct error message of unavailable index Date: Wed, 15 Jun 2011 23:30:32 +0300 Message-ID: <20110615203032.GA8362@redhat.com> References: <20110615142524.26726.13785.stgit@localhost6.localdomain6> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Amos Kong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40063 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319Ab1FOUaR (ORCPT ); Wed, 15 Jun 2011 16:30:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5FKUHRN003279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Jun 2011 16:30:17 -0400 Content-Disposition: inline In-Reply-To: <20110615142524.26726.13785.stgit@localhost6.localdomain6> Sender: kvm-owner@vger.kernel.org List-ID: 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 > --- > 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