[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv3 8/9] cleanup qemu_co_sendv(), qemu_co_recvv()
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [PATCHv3 8/9] cleanup qemu_co_sendv(), qemu_co_recvv() and friends |
Date: |
Tue, 13 Mar 2012 23:35:20 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 |
On 13.03.2012 22:01, Paolo Bonzini wrote:
>>> ssize_t qemu_sendv_recvv(int sockfd, struct iovec *iov,
>>> size_t offset, size_t bytes, bool do_sendv);
> Hmm, since you are at it however, perhaps you could add an argument to
> these functions and qemu_sendv_recvv for the length of the iovec, so
> that it can detect out-of-bounds access.
Yes such an argument may be needed here, and this function
looks differently from the usual iov_* family in this very
place: lack of iov_cnt.
> This would also "fix" the fact
> that you changed the signature of the function in a compatible way,
> while making the API incompatible. As you prefer, but we can call it a
> deal for the #defines. ;)
Heh for the #defines. Defines are fine when used properly,
really. In this case, the #define just adds an argument
and nothing more.
For qemu_sendv and qemu_recvv, I'll just go for renaming these
to be iov_send and iov_recv, and move them to iov.[ch].
And for qemu_co_sendv()&Co, which actually _are_ used, this
wont help anyway. Or I can rename them to qemu_iovec_co_send(),
to catch the change. But it becomes longer... :(
What do you think?
Thank you!
/mjt
- [Qemu-devel] [PATCHv3 1/9] refresh iov_* functions, (continued)
- [Qemu-devel] [PATCHv3 1/9] refresh iov_* functions, Michael Tokarev, 2012/03/12
- [Qemu-devel] [PATCHv3 4/9] consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent, Michael Tokarev, 2012/03/12
- [Qemu-devel] [PATCHv3 5/9] change qemu_iovec_to_buf() to match other to, from_buf functions, Michael Tokarev, 2012/03/12
- [Qemu-devel] [PATCHv3 8/9] cleanup qemu_co_sendv(), qemu_co_recvv() and friends, Michael Tokarev, 2012/03/12
- [Qemu-devel] [PATCHv3 7/9] export qemu_sendv_recvv() and use it in qemu_sendv() and qemu_recvv(), Michael Tokarev, 2012/03/12
- [Qemu-devel] [PATCHv3 3/9] allow qemu_iovec_from_buffer() to specify offset from which to start copying, Michael Tokarev, 2012/03/12
- [Qemu-devel] [PATCHv3 6/9] change prototypes of qemu_sendv() and qemu_recvv(), Michael Tokarev, 2012/03/12
- [Qemu-devel] [PATCHv3 9/9] rewrite and comment qemu_sendv_recvv(), Michael Tokarev, 2012/03/12
- Re: [Qemu-devel] [PATCHv3 0/9] cleanup/consolidate some iovec functions, Michael Tokarev, 2012/03/13