[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv2 6/7] cleanup qemu_co_sendv(), qemu_co_recvv()
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [PATCHv2 6/7] cleanup qemu_co_sendv(), qemu_co_recvv() and friends |
Date: |
Sun, 11 Mar 2012 19:26:22 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 |
On 11.03.2012 19:01, Paolo Bonzini wrote:
> Il 11/03/2012 02:49, Michael Tokarev ha scritto:
>> 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 qemu_sendv_recvv() directly.
>> Also constify buf arg of qemu_co_send().
>>
>> qemu_co_sendv(), qemu_co_recvv(), and qemu_co_recv() are now
>> trivial #define's merely adding one extra arg. qemu_co_send()
>> is an inline function due to `buf' arg de-constification.
>
> Again, I don't see the point in using #defines. Either leave the
> function static, or you can export it but then inlines are preferrable.
When you're debugging in gdb, it always enters all inline functions.
For a very simple #define there's nothing to enter -- hence the
#define.
Note that - I still hope - in the end there will be no sendv or
recv calls at all, only common sendv_recvv with is_write passed
as an argument from upper layer. It will be easier to remove
that #define - just two lines of code instead of minimum 5 :)
Also, in such cases like these, #defines are more compact and
does not clutter the header too much.
>> qemu_co_sendv() and qemu_co_recvv() callers are converted to
>> different argument order.
>
> Paolo
Thanks,
/mjt
- [Qemu-devel] [PATCHv2 5/7] Export qemu_sendv_recvv() and use it in qemu_sendv() and qemu_recvv(), (continued)
- [Qemu-devel] [PATCHv2 5/7] Export qemu_sendv_recvv() and use it in qemu_sendv() and qemu_recvv(), Michael Tokarev, 2012/03/10
- [Qemu-devel] [PATCHv2 1/7] Consolidate qemu_iovec_memset{, _skip}() into single, simplified function, Michael Tokarev, 2012/03/10
- [Qemu-devel] [PATCHv2 2/7] allow qemu_iovec_from_buffer() to specify offset from which to start copying, Michael Tokarev, 2012/03/10
- [Qemu-devel] [PATCHv2 7/7] rewrite and comment qemu_sendv_recvv(), Michael Tokarev, 2012/03/10
- [Qemu-devel] [PATCHv2 4/7] change prototypes of qemu_sendv() and qemu_recvv(), Michael Tokarev, 2012/03/10
- [Qemu-devel] [PATCHv2 6/7] cleanup qemu_co_sendv(), qemu_co_recvv() and friends, Michael Tokarev, 2012/03/10
- Re: [Qemu-devel] [PATCHv2 6/7] cleanup qemu_co_sendv(), qemu_co_recvv() and friends, Paolo Bonzini, 2012/03/11
- Re: [Qemu-devel] [PATCHv2 6/7] cleanup qemu_co_sendv(), qemu_co_recvv() and friends,
Michael Tokarev <=
- Re: [Qemu-devel] [PATCHv2 6/7] cleanup qemu_co_sendv(), qemu_co_recvv() and friends, Paolo Bonzini, 2012/03/12
- Re: [Qemu-devel] [PATCHv2 6/7] cleanup qemu_co_sendv(), qemu_co_recvv() and friends, Michael Tokarev, 2012/03/12
- Re: [Qemu-devel] [PATCHv2 6/7] cleanup qemu_co_sendv(), qemu_co_recvv() and friends, Paolo Bonzini, 2012/03/12
[Qemu-devel] [PATCHv2 3/7] consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent, Michael Tokarev, 2012/03/10
Re: [Qemu-devel] [PATCHv2 0/7] cleanup/consolidate some iovec functions, Michael Tokarev, 2012/03/10
Re: [Qemu-devel] [PATCHv2 0/7] cleanup/consolidate some iovec functions, Paolo Bonzini, 2012/03/11