Add mountinfo support#4
Open
agrover wants to merge 3 commits into
Open
Conversation
added 3 commits
March 1, 2018 15:07
In anticipation of adding parallel support for mountinfo, move support for parsing /proc/mounts (and /etc/fstab) to mount.rs. Modify examples as needed. Signed-off-by: Andy Grover <agrover@redhat.com>
In anticipation of mountinfo, move definitions that both will use to a common location. Signed-off-by: Andy Grover <agrover@redhat.com>
Follows the same code structure as existing support. A MountInfoIter can be created from either /proc/self/mountinfo or /proc/<pid>/mountinfo. There are some basic tests but not quite as thorough and nice as the mounts tests. Add errors to error::LineError as needed for the different fields present in mountinfo. Signed-off-by: Andy Grover <agrover@redhat.com>
Author
|
@l0kod hi, what do you think? Thanks. |
Member
|
It looks good, but I'll get a closer look in the next days. |
Author
|
Thanks! |
Member
|
As a side note, I'm thinking about changing the license from LGPL v3 to LGPL v2.1+. Are you OK with that? |
Author
yes. |
Member
|
Your code looks great! I have some nitpicking but I'll fix that myself. However, I think it make sense to merge mountinfo.rs into mount.rs and get a single (mountinfo) API. Could you extend the mountinfo tests to have at least the same amount of tests as mount.rs? |
Author
|
Yes, I'll work on that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, these commits add support for parsing
/proc/{self, <pid>}/mountinfo, which has some additional fields about mounts, but is not quite a strict superset of what's in/proc/mounts. This would change the API slightly, as shown by the changes to the example code.Please take a look and let me know if this looks ok, thanks!