-
Notifications
You must be signed in to change notification settings - Fork 3
Add mountinfo support #4
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
base: master
Are you sure you want to change the base?
Conversation
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>
|
@l0kod hi, what do you think? Thanks. |
|
It looks good, but I'll get a closer look in the next days. |
|
Thanks! |
|
As a side note, I'm thinking about changing the license from LGPL v3 to LGPL v2.1+. Are you OK with that? |
yes. |
|
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? |
|
Yes, I'll work on that. |
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!