Added the device revision support for linux and fixed NUMANodeID read process#273
Added the device revision support for linux and fixed NUMANodeID read process#273leonardowitt wants to merge 1 commit into
Conversation
jaypipes
left a comment
There was a problem hiding this comment.
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.
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.
Indeed! but this would deserve a separate PR
| return strings.TrimSpace(string(contents)) | ||
| } | ||
|
|
||
| func diskRevision(paths *linuxpath.Paths, disk string) string { |
There was a problem hiding this comment.
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.