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

Get rid of the split semantics, use start & len #13

Merged
merged 2 commits into from
Mar 20, 2024
Merged

Get rid of the split semantics, use start & len #13

merged 2 commits into from
Mar 20, 2024

Conversation

reynir
Copy link
Owner

@reynir reynir commented Mar 20, 2024

While the split semantics can help you partition the disk without overlaps it's mostly annoying because you usually either have a pair of start and end (or last) sectors, or a start sector and a length.

There is a regression of sorts in mirage-block-partition-mbr as we no longer check for overlapping partitions or partitions that include the MBR itself. It could be added back, but I suspect there are not any users of this code. So maybe better to just remove it altogether?!

While the split semantics can help you partition the disk without
overlaps it's mostly annoying because you usually either have a pair of
start and end (or last) sectors, or a start sector and a length.
@reynir reynir linked an issue Mar 20, 2024 that may be closed by this pull request
@reynir reynir merged commit 1649b7a into main Mar 20, 2024
1 check failed
@reynir reynir deleted the no-split branch March 20, 2024 14:06
mseri pushed a commit to ocaml/opam-repository that referenced this pull request Mar 21, 2024
CHANGES:

- BREAKING disconnect no longer disconnects the underlying block device and
  instead marks the partition as disconnected. This does not propagate to
  subpartitions (reynir/mirage-block-partition#9 @dianaoigo)
- BREAKING `connect` and `subpartition` no longer return pairs. Instead,
  `connect` returns a partition representing the whole block device.
  `subpartition` then takes labelled arguments `~start` and `~len`. While the
  "split" semantics has some nice properties it does not fit very well with how
  partitions are specified in partition tables (reynir/mirage-block-partition#13 @reynir)
- mirage-block-partition-mbr is simplified and no longer checks for overlapping
  partitions. The module may be removed or revised in a future release.
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.

Expose a variant of connect that takes offset and length as argument
1 participant