qemu-devel
[Top][All Lists]
Advanced

[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)



reply via email to

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