Skip to content

Properly detect dm devices#301

Open
avishayt wants to merge 1 commit intojaypipes:mainfrom
avishayt:mapper
Open

Properly detect dm devices#301
avishayt wants to merge 1 commit intojaypipes:mainfrom
avishayt:mapper

Conversation

@avishayt
Copy link
Contributor

Fixes: #298

@avishayt avishayt closed this Feb 17, 2022
@jaypipes
Copy link
Owner

@avishayt I apologize for the delay in getting to these reviews, sir. Is there a reason you closed out your PRs?

@avishayt
Copy link
Contributor Author

Wasn't sure the project was still active :)
Reopening

@avishayt avishayt reopened this Feb 22, 2022
Copy link
Collaborator

@ffromani ffromani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the change! the code per se looks good! It would be real nice to have some tests to cover this change, in order to avoid future breakage.
It would be also real nice to have an example of the sysfs directory tree involved here.
Perhaps ghw-snapshot can help to capture that?

Fixes: jaypipes#298
Signed-off-by: Avishay Traeger <avishay@redhat.com>
@avishayt
Copy link
Contributor Author

Added unit tests

SerialNumber string `json:"serial_number"`
WWN string `json:"wwn"`
Partitions []*Partition `json:"partitions"`
Members []string `json:"members"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but let's hear from @jaypipes because of the API-level change

Copy link
Collaborator

@ffromani ffromani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the updates.

// TODO(jaypipes): Move this into diskTypes() once abstracting
// diskIsRotational for ease of unit testing
if !diskIsRotational(ctx, paths, dname) {
if driveType != DRIVE_TYPE_MAPPER && !diskIsRotational(ctx, paths, dname) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will probably need to review this flow more deeply, but that's totally material for another PR. This change LGTM for this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Properly detect dm devices

3 participants

Comments