-
Notifications
You must be signed in to change notification settings - Fork 182
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
Added the device revision support for linux and fixed NUMANodeID read process #273
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, Leonardo, thank you for the contribution!
There's no need to include Windows support in this particular PR, however one thing I would ask is that you actually submit two PRs, one for the fix to the disk's NUMA Node ID collection and the other PR containing the new disk Revision
field. That way, if we need to revert one of the fixes/features, we don't need to revert everything.
Best,
-jay
if nodeContents, err := ioutil.ReadFile(filepath.Join(paths.SysBlock, partial, "numa_node")); err != nil { | ||
if nodeInt, err := strconv.Atoi(string(nodeContents)); err != nil { | ||
if nodeContents, err := ioutil.ReadFile(filepath.Join(paths.SysBlock, partial, "numa_node")); err == nil { | ||
if nodeInt, err := strconv.Atoi(string(nodeContents)); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, Leonardo!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! but this would deserve a separate PR
if nodeContents, err := ioutil.ReadFile(filepath.Join(paths.SysBlock, partial, "numa_node")); err != nil { | ||
if nodeInt, err := strconv.Atoi(string(nodeContents)); err != nil { | ||
if nodeContents, err := ioutil.ReadFile(filepath.Join(paths.SysBlock, partial, "numa_node")); err == nil { | ||
if nodeInt, err := strconv.Atoi(string(nodeContents)); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! but this would deserve a separate PR
@@ -91,6 +91,17 @@ func diskVendor(paths *linuxpath.Paths, disk string) string { | |||
return strings.TrimSpace(string(contents)) | |||
} | |||
|
|||
func diskRevision(paths *linuxpath.Paths, disk string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's ok to add support for linux first and add a TODO for windows/mac
I'm opening it as a draft since I didn't implement the device revision support to Windows.