Skip to content
  • Kevin Wolf's avatar
    d3bd5b90
    nbd: Use low-level QIOChannel API in nbd_read_eof() · d3bd5b90
    Kevin Wolf authored
    
    
    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: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    d3bd5b90
    nbd: Use low-level QIOChannel API in nbd_read_eof()
    Kevin Wolf authored
    
    
    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: default avatarKevin Wolf <kwolf@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Loading