• Bijan Mottahedeh's avatar
    vhost/scsi: Respond to control queue operations · 0d02dbd6
    Bijan Mottahedeh authored
    The vhost-scsi driver currently does not handle any control queue
    operations. In particular, vhost_scsi_ctl_handle_kick, merely prints out
    a debug message but does nothing else. This can cause guest VMs to hang.
    
    As part of SCSI recovery from an error, e.g., an I/O timeout, the SCSI
    midlayer attempts to abort the failed operation. The SCSI virtio driver
    translates the abort to a SCSI TMF request that gets put on the control
    queue (virtscsi_abort -> virtscsi_tmf). The SCSI virtio driver then
    waits indefinitely for this request to be completed, but it never will
    because vhost-scsi never responds to that request.
    
    To avoid a hang, always respond to control queue operations; explicitly
    reject TMF requests, and return a no-op response to event requests.
    Signed-off-by: default avatarBijan Mottahedeh <bijan.mottahedeh@oracle.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    0d02dbd6
scsi.c 61.4 KB