Skip to content

Add mountinfo support - #4

Open
agrover wants to merge 3 commits into
stemjail:masterfrom
agrover:add-mountinfo-support
Open

Add mountinfo support#4
agrover wants to merge 3 commits into
stemjail:masterfrom
agrover:add-mountinfo-support

Conversation

@agrover

@agrover agrover commented Mar 1, 2018

Copy link
Copy Markdown

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

agrover commented Mar 6, 2018

Copy link
Copy Markdown
Author

@l0kod hi, what do you think? Thanks.

@l0kod

l0kod commented Mar 6, 2018

Copy link
Copy Markdown
Member

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

@agrover

agrover commented Mar 7, 2018

Copy link
Copy Markdown
Author

Thanks!

@l0kod

l0kod commented Mar 9, 2018

Copy link
Copy Markdown
Member

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

@agrover

agrover commented Mar 9, 2018

Copy link
Copy Markdown
Author

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

l0kod commented Mar 12, 2018

Copy link
Copy Markdown
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?

@agrover

agrover commented Mar 12, 2018

Copy link
Copy Markdown
Author

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