Skip to content
  • Paolo Bonzini's avatar
    block: take lock around bdrv_read implementations · 2914caa0
    Paolo Bonzini authored
    
    
    This does the first part of the conversion to coroutines, by
    wrapping bdrv_read implementations to take the mutex.
    
    Drivers that implement bdrv_read rather than bdrv_co_readv can
    then benefit from asynchronous operation (at least if the underlying
    protocol supports it, which is not the case for raw-win32), even
    though they still operate with a bounce buffer.
    
    raw-win32 does not need the lock, because it cannot yield.
    nbd also doesn't probably, but better be safe.
    
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    2914caa0