Add volume event handling to virtio scsi driver #1628
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Virtio scsi uses the event queue to pass asynchronous information about
volumes added or removed. This change implements handling of these events.
Virtio scsi disks for a scsi device are now stored in a vector for lookup
by the event handler. The rescan event sends an inquiry to the lun specified
in the event, unless than lun is zero, which triggers a report luns for
the target, as indicated by the specification. LUNs that are detected in this
rescan are not re-added if they already exist in the disk list.
I had implemented handling of unit attention sense codes but I could not trigger
them on GCP, so I left it out of this PR as I was unable to test it and that handling
is more complicated.