From: Hannes Reinecke <hare@suse.de>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: stefanha@gmail.com, qemu-devel@nongnu.org, nab@linux-iscsi.org
Subject: Re: [Qemu-devel] Re: [PATCH 09/16] scsi-disk: Allocate iovec dynamically
Date: Thu, 18 Nov 2010 17:28:44 +0100 [thread overview]
Message-ID: <4CE5543C.2080701@suse.de> (raw)
In-Reply-To: <4CE54755.8010205@redhat.com>
On 11/18/2010 04:33 PM, Gerd Hoffmann wrote:
> 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?
>
Yes. But I'm passing passing in an entire iovec to the request.
However, the QEMUIOVector routines allow you to add only _one_
element at a time, which is pretty wasteful here.
And I'm counting the resulting length of the iovec, which might have
been changed by read/write operations. For which there is no generic
function either.
But if requested I could easily move it into cutils.c.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
next prev parent reply other threads:[~2010-11-18 16:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 14:47 [Qemu-devel] [PATCH 09/16] scsi-disk: Allocate iovec dynamically Hannes Reinecke
2010-11-18 15:33 ` [Qemu-devel] " Gerd Hoffmann
2010-11-18 16:28 ` Hannes Reinecke [this message]
2010-11-19 11:43 ` Kevin Wolf
2010-11-19 12:30 ` Hannes Reinecke
2010-11-19 12:46 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CE5543C.2080701@suse.de \
--to=hare@suse.de \
--cc=kraxel@redhat.com \
--cc=nab@linux-iscsi.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.