Skip to content
  • Stefan Hajnoczi's avatar
    block: acquire AioContext in do_drive_del() · 8ad4202b
    Stefan Hajnoczi authored
    
    
    Make drive_del safe for dataplane where another thread may be running
    the BlockDriverState's AioContext.
    
    Note the assumption that AioContext's lifetime exceeds DriveInfo and
    BlockDriverState.  We release AioContext after DriveInfo and
    BlockDriverState are potentially freed.
    
    This is clearly safe with the global AioContext but also with -object
    iothread and implicit iothreads created by -device
    virtio-blk-pci,x-data-plane=on (their lifetime is tied to DeviceState,
    not BlockDriverState).
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    8ad4202b