[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv4 10/11] cleanup qemu_co_sendv(), qemu_co_recvv(
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [PATCHv4 10/11] cleanup qemu_co_sendv(), qemu_co_recvv() and friends |
Date: |
Fri, 16 Mar 2012 23:37:04 +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:22, Anthony Liguori wrote:
> On 03/15/2012 04:00 PM, Michael Tokarev wrote:
>> The same as for non-coroutine versions in previous
>> patches: rename arguments to be more obvious, change
>> type of arguments from int to size_t where appropriate,
>> and use common code for send and receive paths (with
>> one extra argument) since these are exactly the same.
>> Use common iov_send_recv() directly.
>>
>> qemu_co_sendv(), qemu_co_recvv(), and qemu_co_recv()
>> are now trivial #define's merely adding one extra arg.
>>
>> qemu_co_sendv() and qemu_co_recvv() callers are
>> converted to different argument order and extra
>> `iov_cnt' argument.
>>
>> Cc: MORITA Kazutaka<address@hidden>
>> Cc: Paolo Bonzini<address@hidden>
>> Signed-off-by: Michael Tokarev<address@hidden>
>
> Same comments here re: macros.
And the same answer. There are cases when macros are okay,
like this example which is being rejected, and there are
cases where macros are definitely wrong (qemu_recv()),
which are accepted.
Thanks,
/mjt
>> +ssize_t qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool
>> do_send);
>> +#define qemu_co_recv(sockfd, buf, bytes) \
>> + qemu_co_send_recv(sockfd, buf, bytes, false)
>> +#define qemu_co_send(sockfd, buf, bytes) \
>> + qemu_co_send_recv(sockfd, buf, bytes, true)
- Re: [Qemu-devel] [PATCHv4 09/11] export iov_send_recv() and use it in iov_send() and iov_recv(), (continued)
- [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
- [Qemu-devel] [PATCHv4 10/11] cleanup qemu_co_sendv(), qemu_co_recvv() and friends, Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 06/11] consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent, Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 11/11] rewrite iov_send_recv() and move it to iov.c, Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 07/11] change qemu_iovec_to_buf() to match other to, from_buf functions, Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 05/11] allow qemu_iovec_from_buffer() to specify offset from which to start copying, Michael Tokarev, 2012/03/15
- [Qemu-devel] [PATCHv4 02/11] change iov_* function prototypes to be more appropriate, Michael Tokarev, 2012/03/15