From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfJeo-0006p3-7f for qemu-devel@nongnu.org; Thu, 24 Sep 2015 23:26:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfJel-0000Xa-30 for qemu-devel@nongnu.org; Thu, 24 Sep 2015 23:26:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfJek-0000XT-Ts for qemu-devel@nongnu.org; Thu, 24 Sep 2015 23:26:43 -0400 References: <1443100738-14970-1-git-send-email-mst@redhat.com> <1443100738-14970-21-git-send-email-mst@redhat.com> <20150924215731-mutt-send-email-mst@redhat.com> From: Jason Wang Message-ID: <5604BEEF.2040608@redhat.com> Date: Fri, 25 Sep 2015 11:26:39 +0800 MIME-Version: 1.0 In-Reply-To: <20150924215731-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 20/22] virtio: introduce virtqueue_unmap_sg() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Peter Maydell On 09/25/2015 02:58 AM, Michael S. Tsirkin wrote: > On Thu, Sep 24, 2015 at 04:21:02PM +0300, Michael S. Tsirkin wrote: >> From: Jason Wang >> >> Factor out sg unmapping logic. This will be reused by the patch that >> can discard descriptor. >> >> Cc: Michael S. Tsirkin >> Signed-off-by: Jason Wang >> Reviewed-by: Michael S. Tsirkin >> Signed-off-by: Michael S. Tsirkin >> --- >> hw/virtio/virtio.c | 15 ++++++++++----- >> 1 file changed, 10 insertions(+), 5 deletions(-) >> >> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c >> index 7504f8b..d6a2bca 100644 >> --- a/hw/virtio/virtio.c >> +++ b/hw/virtio/virtio.c >> @@ -244,15 +244,12 @@ int virtio_queue_empty(VirtQueue *vq) >> return vring_avail_idx(vq) == vq->last_avail_idx; >> } >> >> -void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem, >> - unsigned int len, unsigned int idx) >> +static void virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem, >> + unsigned int len) >> { >> unsigned int offset; >> int i; >> >> - trace_virtqueue_fill(vq, elem, len, idx); >> - >> - offset = 0; >> for (i = 0; i < elem->in_num; i++) { >> size_t size = MIN(len - offset, elem->in_sg[i].iov_len); >> > This part causes an unitialized variable warning to appear. > I dropped this from the pull request. > Jason, could you look into this please? > Will fix this in V2. Thanks