[Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client

2017-10-09 Thread Vladimir Sementsov-Ogievskiy
Minimal implementation: for structured error only error_report error message. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 6 + block/nbd-client.c | 358 nbd/client.c| 7 + 3 files changed, 343 insertions(

Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client

2017-10-10 Thread Paolo Bonzini
On 09/10/2017 19:27, Vladimir Sementsov-Ogievskiy wrote: > > +int ret = nbd_co_do_receive_one_chunk(s, handle, only_structured, > + &request_ret, qiov, payload); > + > +if (ret < 0) { > +s->quit = true; > +} else { > +/* For asse

Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client

2017-10-10 Thread Vladimir Sementsov-Ogievskiy
09.10.2017 20:27, Vladimir Sementsov-Ogievskiy wrote: Minimal implementation: for structured error only error_report error message. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 6 + block/nbd-client.c | 358 nb

Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client

2017-10-10 Thread Vladimir Sementsov-Ogievskiy
10.10.2017 11:02, Paolo Bonzini wrote: On 09/10/2017 19:27, Vladimir Sementsov-Ogievskiy wrote: +int ret = nbd_co_do_receive_one_chunk(s, handle, only_structured, + &request_ret, qiov, payload); + +if (ret < 0) { +s->quit = true; +} el

Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client

2017-10-10 Thread Paolo Bonzini
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

Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client

2017-10-11 Thread Vladimir Sementsov-Ogievskiy
10.10.2017 18:00, Paolo Bonzini wrote: 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: fu

Re: [Qemu-block] [PATCH v2 10/10] nbd: Minimal structured read for client

2017-10-11 Thread Vladimir Sementsov-Ogievskiy
10.10.2017 11:02, Paolo Bonzini wrote: On 09/10/2017 19:27, Vladimir Sementsov-Ogievskiy wrote: +int ret = nbd_co_do_receive_one_chunk(s, handle, only_structured, + &request_ret, qiov, payload); + +if (ret < 0) { +s->quit = true; +} el