[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 07/17] block/nbd-client: refactor request send/r
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH 07/17] block/nbd-client: refactor request send/receive |
Date: |
Fri, 25 Aug 2017 13:49:36 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 08/04/2017 10:14 AM, Vladimir Sementsov-Ogievskiy wrote:
> Move nbd_co_receive_reply and nbd_coroutine_end calls into
> nbd_co_send_request and rename the latter to just nbd_co_request.
>
> This removes code duplications in nbd_client_co_{pwrite,pread,...}
> functions. Also this is needed for further refactoring.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> block/nbd-client.c | 89
> ++++++++++++++++++++----------------------------------
> 1 file changed, 33 insertions(+), 56 deletions(-)
The diffstat shows this is a nice improvement.
> +++ b/block/nbd-client.c
> @@ -112,12 +112,20 @@ static coroutine_fn void nbd_read_reply_entry(void
> *opaque)
> s->read_reply_co = NULL;
> }
>
> -static int nbd_co_send_request(BlockDriverState *bs,
> - NBDRequest *request,
> - QEMUIOVector *qiov)
> +static void nbd_co_receive_reply(NBDClientSession *s,
> + NBDRequest *request,
> + NBDReply *reply,
> + QEMUIOVector *qiov);
> +static void nbd_coroutine_end(BlockDriverState *bs,
> + NBDRequest *request);
Is it possible to organize the functions in topological order so that we
don't need forward declarations of static functions? (If there is
mutual recursion, you need the forward declaration; but other than that,
I like reading the building blocks first rather than skipping around)
Otherwise,
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH 10/17] block/nbd-client: move nbd_coroutine_end content into nbd_co_request, (continued)
- [Qemu-block] [PATCH 13/17] block/nbd-client: refactor NBDClientSession.recv_coroutine, Vladimir Sementsov-Ogievskiy, 2017/08/04
- [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry, Vladimir Sementsov-Ogievskiy, 2017/08/04
- Re: [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry, Eric Blake, 2017/08/07
- Re: [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry, Vladimir Sementsov-Ogievskiy, 2017/08/07
- Re: [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry, Eric Blake, 2017/08/07
- Re: [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry, Eric Blake, 2017/08/07
- Re: [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry, Vladimir Sementsov-Ogievskiy, 2017/08/07
- Re: [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry, Eric Blake, 2017/08/07
[Qemu-block] [PATCH 07/17] block/nbd-client: refactor request send/receive, Vladimir Sementsov-Ogievskiy, 2017/08/04
- Re: [Qemu-block] [PATCH 07/17] block/nbd-client: refactor request send/receive,
Eric Blake <=
[Qemu-block] [PATCH 11/17] block/nbd-client: fix nbd_co_request: set s->reply.handle to 0 on error, Vladimir Sementsov-Ogievskiy, 2017/08/04
[Qemu-block] [PATCH 08/17] block/nbd-client: rename nbd_recv_coroutines_enter_all, Vladimir Sementsov-Ogievskiy, 2017/08/04
[Qemu-block] [PATCH 09/17] block/nbd-client: move nbd_co_receive_reply content into nbd_co_request, Vladimir Sementsov-Ogievskiy, 2017/08/04
[Qemu-block] [PATCH 15/17] block/nbd-client: refactor reading reply, Vladimir Sementsov-Ogievskiy, 2017/08/04