vhost/scsi: Respond to control queue operations
authorBijan Mottahedeh <bijan.mottahedeh@oracle.com>
Tue, 18 Sep 2018 00:09:47 +0000 (17:09 -0700)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 25 Oct 2018 01:16:13 +0000 (21:16 -0400)
commit0d02dbd68c47b66367130b696baef7246720791c
treed0f5fe1edcc46df92d890e443e1b5d6d9b1be9a1
parent4542d623c7134bc1738f8a68ccb6dd546f1c264f
vhost/scsi: Respond to control queue operations

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: Bijan Mottahedeh <bijan.mottahedeh@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/scsi.c