On 2/18/19 10:18 AM, Kevin Wolf wrote: > Instead of using the convenience wrapper qio_channel_read_all_eof(), use > the lower level QIOChannel API. This means duplicating some code, but > we'll need this because this coroutine yield is special: We want it to > be interruptible so that nbd_client_attach_aio_context() can correctly > reenter the coroutine. > > This moves the bdrv_dec/inc_in_flight() pair into nbd_read_eof(), so > that connection_co will always sit in this exact qio_channel_yield() > call when bdrv_drain() returns. > > Signed-off-by: Kevin Wolf <[email protected]> > --- > include/block/nbd.h | 4 ++-- > block/nbd-client.c | 8 +------- > nbd/client.c | 46 ++++++++++++++++++++++++++++++++++++--------- > 3 files changed, 40 insertions(+), 18 deletions(-) >
Reviewed-by: Eric Blake <[email protected]> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
