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<morita.kazut...@lab.ntt.co.jp>
>> Cc: Paolo Bonzini<pbonz...@redhat.com>
>> Signed-off-by: Michael Tokarev<m...@tls.msk.ru>
> 
> 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)

Reply via email to