Merge ~dbungert/curtin:pmem into curtin:master

Proposed by Dan Bungert
Status: Work in progress
Proposed branch: ~dbungert/curtin:pmem
Merge into: curtin:master
Diff against target: 29 lines (+5/-2)
2 files modified
curtin/block/__init__.py (+1/-1)
tests/unittests/test_block.py (+4/-1)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Needs Fixing
curtin developers Pending
Review via email: mp+427507@code.launchpad.net

Commit message

block_meta: fix for pmem kname lookup

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I went and found the logic in the kernel that decides whether a partition gets a p and it's way simpler than what we do in curtin: https://github.com/torvalds/linux/blob/master/block/partitions/core.c#L141. We should make our logic simpler too :)

Revision history for this message
Dan Bungert (dbungert) wrote :

Unmerged commits

2706b81... by Dan Bungert

block_meta: fix for pmem kname lookup

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/__init__.py b/curtin/block/__init__.py
2index 49b062f..8510a01 100644
3--- a/curtin/block/__init__.py
4+++ b/curtin/block/__init__.py
5@@ -133,7 +133,7 @@ def partition_kname(disk_kname, partition_number):
6 partition_number)))
7
8 for dev_type in ['bcache', 'nvme', 'mmcblk', 'cciss', 'mpath', 'md',
9- 'loop']:
10+ 'loop', 'pmem']:
11 if disk_kname.startswith(dev_type):
12 partition_number = "p%s" % partition_number
13 break
14diff --git a/tests/unittests/test_block.py b/tests/unittests/test_block.py
15index 7a73b69..9dff854 100644
16--- a/tests/unittests/test_block.py
17+++ b/tests/unittests/test_block.py
18@@ -457,7 +457,10 @@ class TestBlockKnames(CiTestCase):
19 (('cciss!c0d0', 1), 'cciss!c0d0p1'),
20 (('dm-0', 1), 'dm-1'),
21 (('md0', 1), 'md0p1'),
22- (('mpath1', 2), 'mpath1p2')]
23+ (('mpath1', 2), 'mpath1p2'),
24+ (('pmem0', 1), 'pmem0p1'),
25+ ]
26+
27 for ((disk_kname, part_number), part_kname) in part_knames:
28 self.assertEqual(part_kname,
29 block.partition_kname(disk_kname, part_number))

Subscribers

People subscribed via source and target branches