From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCTY3-00056U-59 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 07:59:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCTXx-0005ui-AW for qemu-devel@nongnu.org; Thu, 22 Aug 2013 07:59:31 -0400 Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]:49038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCTXx-0005ua-51 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 07:59:25 -0400 Received: by mail-ea0-f169.google.com with SMTP id k11so865487eaj.0 for ; Thu, 22 Aug 2013 04:59:24 -0700 (PDT) Date: Thu, 22 Aug 2013 13:59:21 +0200 From: Stefan Hajnoczi Message-ID: <20130822115921.GD27613@stefanha-thinkpad.redhat.com> References: <2952D48C-BC95-446D-92E8-04DE2BC3B873@cs2c.com.cn> <20130819143054.GA9866@stefanha-thinkpad.redhat.com> <2BABA7CB-E607-45AF-B2B5-838C2BC5735A@cs2c.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2BABA7CB-E607-45AF-B2B5-838C2BC5735A@cs2c.com.cn> Subject: Re: [Qemu-devel] [PATCH]virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over the indirect descriptor table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: yinyin Cc: Amit Shah , "qemu-devel@nongnu.org" , "Michael S. Tsirkin" On Thu, Aug 22, 2013 at 02:47:16PM +0800, yinyin wrote: > virtqueue_get_avail_bytes: when found a indirect desc, we need loop over it. > /* loop over the indirect descriptor table */ > indirect = 1; > max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc); > num_bufs = i = 0; > desc_pa = vring_desc_addr(desc_pa, i); > But, It init i to 0, then use i to update desc_pa. so we will always get: > desc_pa = vring_desc_addr(desc_pa, 0); > the last two line should swap. > > Signed-off-by: Yin Yin > --- > hw/virtio/virtio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi