[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for clien
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client |
Date: |
Tue, 10 Oct 2017 17:00:46 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 10/10/2017 16:55, Vladimir Sementsov-Ogievskiy wrote:
> Hmm, would it be simpler just pass a function pointer, which should be
> called on each loop iteration?
> So, we will return to one common func nbd_co_receive_reply, but with two
> additional parameters: func and opaque?
Function pointers typically result in having to pass the state around in
a structure, for all the callers.
An iterator also has to package the state in a structure, but it is only
done once.
So function pointers would be simpler in the beginning, but would not
scale as well.
Paolo
- [Qemu-block] [PATCH v2 6/7] block/nbd-client: early fail nbd_read_reply_entry if s->quit is set, (continued)
- [Qemu-block] [PATCH v2 6/7] block/nbd-client: early fail nbd_read_reply_entry if s->quit is set, Vladimir Sementsov-Ogievskiy, 2017/10/09
- [Qemu-block] [PATCH v2 3/7] block/nbd-client: refactor reading reply, Vladimir Sementsov-Ogievskiy, 2017/10/09
- [Qemu-block] [PATCH v2 09/10] nbd/client: prepare nbd_receive_reply for structured reply, Vladimir Sementsov-Ogievskiy, 2017/10/09
- [Qemu-block] [PATCH v2 03/10] nbd: rename NBD_REPLY_MAGIC to NBD_SIMPLE_REPLY_MAGIC, Vladimir Sementsov-Ogievskiy, 2017/10/09
- [Qemu-block] [PATCH v2 1/7] block/nbd-client: refactor nbd_co_receive_reply, Vladimir Sementsov-Ogievskiy, 2017/10/09
- [Qemu-block] [PATCH v2 2/7] block/nbd-client: exit reply-reading coroutine on incorrect handle, Vladimir Sementsov-Ogievskiy, 2017/10/09
- [Qemu-block] [PATCH v2 5/7] block/nbd-client: nbd_co_send_request: return -EIO if s->quit was set in parallel, Vladimir Sementsov-Ogievskiy, 2017/10/09
- [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client, Vladimir Sementsov-Ogievskiy, 2017/10/09
- Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client, Vladimir Sementsov-Ogievskiy, 2017/10/11
- Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client, Vladimir Sementsov-Ogievskiy, 2017/10/10
[Qemu-block] [PATCH v2 04/10] nbd-server: refactor simple reply sending, Vladimir Sementsov-Ogievskiy, 2017/10/09
[Qemu-block] [PATCH v2 06/10] nbd: Minimal structured read for server, Vladimir Sementsov-Ogievskiy, 2017/10/09
[Qemu-block] [PATCH v2 08/10] nbd: share some nbd entities to be reused in block/nbd-client.c, Vladimir Sementsov-Ogievskiy, 2017/10/09