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