Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May disk's driver type need more checks #296

Open
nevermore-muyi opened this issue Jan 19, 2022 · 5 comments
Open

May disk's driver type need more checks #296

nevermore-muyi opened this issue Jan 19, 2022 · 5 comments

Comments

@nevermore-muyi
Copy link

As the code https://github.com/jaypipes/ghw/blob/main/pkg/block/block_linux.go#L271 shows, when I create a device mapper device which starts with dm- prefix, and the function https://github.com/jaypipes/ghw/blob/main/pkg/block/block_linux.go#L316 thinks it's a unknown device, but (https://github.com/jaypipes/ghw/blob/main/pkg/block/block_linux.go#L274) may define it's a SSD.
image

So, in my option, driver type may need more checks.

@jaypipes
Copy link
Owner

@nevermore-muyi hi! thanks for your submission!

Are you suggesting that instead of returning an UNKNOWN disk type, we should check for whether the disk is rotational, and if not, return SSD disk type?

@nevermore-muyi
Copy link
Author

@jaypipes Maybe a little different. I suggest only KNOWN disk type needs more check if it's rotational and define it's a SSD, but UNKNOWN disk type, just return it?

@ffromani
Copy link
Collaborator

I tend to agree the code should not set the drive type depending only on the value of rotational

@jaypipes
Copy link
Owner

@nevermore-muyi we are considering creating a separate package for devicemappings/devicemapper. See conversation here.

@nevermore-muyi
Copy link
Author

@nevermore-muyi we are considering creating a separate package for devicemappings/devicemapper. See conversation here.

Got it. Looks very cool.

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

No branches or pull requests

3 participants