From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36103 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ6Uk-0003IQ-Rz for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:33:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ6Uj-0003by-BJ for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:33:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJ6Uj-0003bo-2w for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:33:53 -0500 Message-ID: <4CE54755.8010205@redhat.com> Date: Thu, 18 Nov 2010 16:33:41 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <20101118144723.61032F90AB@ochil.suse.de> In-Reply-To: <20101118144723.61032F90AB@ochil.suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 09/16] scsi-disk: Allocate iovec dynamically List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hannes Reinecke Cc: stefanha@gmail.com, qemu-devel@nongnu.org, nab@linux-iscsi.org Hi, > +static size_t scsi_req_iov_len(SCSIDiskReq *r) > +{ > + size_t iov_len = 0; > + int i; > + > + for (i = 0; i< r->iov_num; i++) > + iov_len += r->iov[i].iov_len; > + > + return iov_len; > +} You are aware that there is a QEMUIOVector type with helper functions which keeps track of both number of elements and total size? cheers, Gerd