|
From: | Gerd Hoffmann |
Subject: | [Qemu-devel] Re: [PATCH 09/16] scsi-disk: Allocate iovec dynamically |
Date: | Thu, 18 Nov 2010 16:33:41 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100827 Red Hat/3.1.3-1.el6 Thunderbird/3.1.3 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |