Skip to content
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

Add support for /proc/partitions parsing #286

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

berrange
Copy link
Contributor

@berrange berrange commented Oct 2, 2023

This parses the data looking like:

$ cat /proc/partitions
major minor #blocks name

259 0 1000204632 nvme0n1
259 1 1048576 nvme0n1p1
259 2 1048576 nvme0n1p2
259 3 104857600 nvme0n1p3
259 4 893248512 nvme0n1p4
253 0 104841216 dm-0
252 0 8388608 zram0
253 1 893232128 dm-1
8 0 3953664 sda
8 1 2097152 sda1
8 2 1855488 sda2
253 2 1853440 dm-2

with the first two lines discarded when parsing.

This parses the data looking like:

  $ cat /proc/partitions
  major minor  #blocks  name

   259        0 1000204632 nvme0n1
   259        1    1048576 nvme0n1p1
   259        2    1048576 nvme0n1p2
   259        3  104857600 nvme0n1p3
   259        4  893248512 nvme0n1p4
   253        0  104841216 dm-0
   252        0    8388608 zram0
   253        1  893232128 dm-1
     8        0    3953664 sda
     8        1    2097152 sda1
     8        2    1855488 sda2
   253        2    1853440 dm-2

with the first two lines discarded when parsing.

Signed-off-by: Daniel P. Berrangé <[email protected]>
@eminence
Copy link
Owner

eminence commented Oct 4, 2023

LGTM, thanks!

@eminence eminence merged commit e8e9bc1 into eminence:master Oct 4, 2023
6 checks passed
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