Skip to content

Conversation

@agrover
Copy link

@agrover agrover commented Mar 1, 2018

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!

Andy Grover 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>
@agrover
Copy link
Author

agrover commented Mar 6, 2018

@l0kod hi, what do you think? Thanks.

@l0kod
Copy link
Member

l0kod commented Mar 6, 2018

It looks good, but I'll get a closer look in the next days.

@agrover
Copy link
Author

agrover commented Mar 7, 2018

Thanks!

@l0kod
Copy link
Member

l0kod commented Mar 9, 2018

As a side note, I'm thinking about changing the license from LGPL v3 to LGPL v2.1+. Are you OK with that?

@agrover
Copy link
Author

agrover commented Mar 9, 2018

As a side note, I'm thinking about changing the license from LGPL v3 to LGPL v2.1+. Are you OK with that?

yes.

@l0kod
Copy link
Member

l0kod commented Mar 12, 2018

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?

@agrover
Copy link
Author

agrover commented Mar 12, 2018

Yes, I'll work on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants