From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8cxs-0004f7-Eg for qemu-devel@nongnu.org; Fri, 16 Mar 2012 15:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8cxX-0006RT-5a for qemu-devel@nongnu.org; Fri, 16 Mar 2012 15:37:28 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:50326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8cxW-0006Qx-U9 for qemu-devel@nongnu.org; Fri, 16 Mar 2012 15:37:07 -0400 Message-ID: <4F639660.8030403@msgid.tls.msk.ru> Date: Fri, 16 Mar 2012 23:37:04 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1331845217-21705-1-git-send-email-mjt@msgid.tls.msk.ru> <1331845217-21705-11-git-send-email-mjt@msgid.tls.msk.ru> <4F6368D9.3070507@codemonkey.ws> In-Reply-To: <4F6368D9.3070507@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv4 10/11] cleanup qemu_co_sendv(), qemu_co_recvv() and friends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel@nongnu.org, MORITA Kazutaka 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 >> Cc: Paolo Bonzini >> Signed-off-by: Michael Tokarev > > 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)