qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]