[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv4 09/11] export iov_send_recv() and use it in io
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [PATCHv4 09/11] export iov_send_recv() and use it in iov_send() and iov_recv() |
Date: |
Fri, 16 Mar 2012 20:43:08 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 |
On 16.03.2012 20:21, Anthony Liguori wrote:
> On 03/15/2012 04:00 PM, Michael Tokarev wrote:
[]
>> +ssize_t iov_send_recv(int sockfd, struct iovec *iov,
>> + size_t offset, size_t bytes, bool do_send);
>> +#define iov_recv(sockfd, iov, offset, bytes) \
>> + iov_send_recv(sockfd, iov, offset, bytes, false)
>> +#define iov_send(sockfd, iov, offset, bytes) \
>> + iov_send_recv(sockfd, iov, offset, bytes, true)
>
> Please use a static inline instead of a macro. Macros make compiler
> errors/warnings confusing.
Macros are good when used properly, and this is one of examples
of good usage: no confusion in this case.
An example of really confusing macro which were accepted recently
is qemu_recv, which not only makes errors/warning confusing, but
also makes type checking impossible.
I can change these into inline functions, but that just takes
much more lines of "code" and more difficult to see what it
does.
Thanks,
/mjt
- [Qemu-devel] [PATCHv4 00/11] cleanup/consolidate iovec functions, Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 09/11] export iov_send_recv() and use it in iov_send() and iov_recv(), Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 08/11] rename qemu_sendv to iov_send, change proto and move declarations to iov.h, Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 01/11] virtio-serial-bus: use correct lengths in control_out() message, Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 04/11] consolidate qemu_iovec_memset{, _skip}() into single function and use existing iov_memset(), Michael Tokarev, 2012/03/15
- Re: [Qemu-devel] [PATCHv4 04/11] consolidate qemu_iovec_memset{, _skip}() into single function and use existing iov_memset(), Anthony Liguori, 2012/03/16
- Re: [Qemu-devel] [PATCHv4 04/11] consolidate qemu_iovec_memset{, _skip}() into single function and use existing iov_memset(), Stefan Hajnoczi, 2012/03/19
- Re: [Qemu-devel] [PATCHv4 04/11] consolidate qemu_iovec_memset{, _skip}() into single function and use existing iov_memset(), Michael Tokarev, 2012/03/19
- Re: [Qemu-devel] [PATCHv4 04/11] consolidate qemu_iovec_memset{, _skip}() into single function and use existing iov_memset(), Anthony Liguori, 2012/03/19
- Re: [Qemu-devel] [PATCHv4 04/11] consolidate qemu_iovec_memset{, _skip}() into single function and use existing iov_memset(), Stefan Hajnoczi, 2012/03/20