Use vector for INQUIRY data, LUN list can have gaps, made methods const#713
Merged
Use vector for INQUIRY data, LUN list can have gaps, made methods const#713
Conversation
This reverts commit 38412b8.
akuker
reviewed
Mar 2, 2022
|
|
||
| return size; | ||
| // Optical memory device, SCSI-2, removable | ||
| return PrimaryDevice::Inquiry(7, 2, true); |
Member
There was a problem hiding this comment.
I think the SCSI Type (first argument) should be some sort of constant/enum/something to make this more readable. This PR has already been hanging out too long, so this would be a nice-to-have change somewhere down the line.
Contributor
Author
There was a problem hiding this comment.
@akuker Yes, you are right. I will prepare a new ticket for that.
akuker
approved these changes
Mar 2, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Inquiry() returns vector instead of accepting BYTE * and is declared const. This reduces the risk of memory issues and side-effects.
All devices make use of PrimaryDevice::Inquiry(), which elimates code duplication.
Moved error codes to existing scsi_defs namespace.
Fixed ReadDefectData10.
Do not use sorted maps/sets where not needed.
The LUNs list can have gaps, but LUN 0 is mandatory as long as there is also another LUN.