From patchwork Wed Jun 15 14:25:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 882202 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5FEPYEN019970 for ; Wed, 15 Jun 2011 14:25:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755221Ab1FOOZ3 (ORCPT ); Wed, 15 Jun 2011 10:25:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58714 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754935Ab1FOOZ2 (ORCPT ); Wed, 15 Jun 2011 10:25:28 -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 p5FEPSIs015538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Jun 2011 10:25:28 -0400 Received: from localhost6.localdomain6 (vpn1-112-40.nay.redhat.com [10.66.112.40]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p5FEPQXR018352; Wed, 15 Jun 2011 10:25:27 -0400 Subject: [PATCH 1/3] virtio: Correct error message of unavailable index To: mst@redhat.com From: Amos Kong Cc: kvm@vger.kernel.org Date: Wed, 15 Jun 2011 22:25:24 +0800 Message-ID: <20110615142524.26726.13785.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 15 Jun 2011 14:25:34 +0000 (UTC) '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(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); }