Skip to content

Add support for /proc/partitions parsing#286

Merged
eminence merged 1 commit intoeminence:masterfrom
berrange:partitions
Oct 4, 2023
Merged

Add support for /proc/partitions parsing#286
eminence merged 1 commit intoeminence:masterfrom
berrange:partitions

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
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