-
Notifications
You must be signed in to change notification settings - Fork 243
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
Implement ReadMemInfo on FreeBSD #1239
Conversation
pkg/system/meminfo_freebsd.go
Outdated
total int64 = 0 | ||
used int64 = 0 | ||
) | ||
for i := 0; ; i++ { |
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.
Just a question: Can you get number of swap devices using nswapdev
instead infinite loop.
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.
Good idea - I was kind of following the algorithm used in the base system's swapinfo command but this is better.
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.
@dfr I am not aware about BSD a lot so i am not even sure about it. It was just a question or rather a discussion, you can feel free to discuss more about that as there is no requirement to change code right away :). Could you help checking if it does not breaks anything else.
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.
I re-tested using 'podman info' and verified that it still reads the swap details. I also noticed that it mixed up used and free totals for swap so I fixed that.
Two questions above. |
if MemTotal < 0 || MemFree < 0 || SwapTotal < 0 || SwapFree < 0 { | ||
return nil, fmt.Errorf("error getting system memory info %v\n", err) | ||
} |
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.
I don't think any of these can be negative if the two calls above succeed. Perhaps this can change to an assert?
1c49f8d
to
c2c7936
Compare
Signed-off-by: Doug Rabson <[email protected]>
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.
LGTM @containers/storage-maintainers PTAL
LGTM |
Signed-off-by: Doug Rabson [email protected]