Skip to content
  • Stefan Hajnoczi's avatar
    766aa2de
    virtio-scsi: implement BlockDevOps->drained_begin() · 766aa2de
    Stefan Hajnoczi authored
    
    
    The virtio-scsi Host Bus Adapter provides access to devices on a SCSI
    bus. Those SCSI devices typically have a BlockBackend. When the
    BlockBackend enters a drained section, the SCSI device must temporarily
    stop submitting new I/O requests.
    
    Implement this behavior by temporarily stopping virtio-scsi virtqueue
    processing when one of the SCSI devices enters a drained section. The
    new scsi_device_drained_begin() API allows scsi-disk to message the
    virtio-scsi HBA.
    
    scsi_device_drained_begin() uses a drain counter so that multiple SCSI
    devices can have overlapping drained sections. The HBA only sees one
    pair of .drained_begin/end() calls.
    
    After this commit, virtio-scsi no longer depends on hw/virtio's
    ioeventfd aio_set_event_notifier(is_external=true). This commit is a
    step towards removing the aio_disable_external() API.
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20230516190238.8401-19-stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    766aa2de
    virtio-scsi: implement BlockDevOps->drained_begin()
    Stefan Hajnoczi authored
    
    
    The virtio-scsi Host Bus Adapter provides access to devices on a SCSI
    bus. Those SCSI devices typically have a BlockBackend. When the
    BlockBackend enters a drained section, the SCSI device must temporarily
    stop submitting new I/O requests.
    
    Implement this behavior by temporarily stopping virtio-scsi virtqueue
    processing when one of the SCSI devices enters a drained section. The
    new scsi_device_drained_begin() API allows scsi-disk to message the
    virtio-scsi HBA.
    
    scsi_device_drained_begin() uses a drain counter so that multiple SCSI
    devices can have overlapping drained sections. The HBA only sees one
    pair of .drained_begin/end() calls.
    
    After this commit, virtio-scsi no longer depends on hw/virtio's
    ioeventfd aio_set_event_notifier(is_external=true). This commit is a
    step towards removing the aio_disable_external() API.
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20230516190238.8401-19-stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading