Skip to content

feat: support multiple MirageOS block devices - #908

Open
pocopepe wants to merge 1 commit into
urunc-dev:mainfrom
pocopepe:fix/315-mirage-multiple-devices
Open

feat: support multiple MirageOS block devices#908
pocopepe wants to merge 1 commit into
urunc-dev:mainfrom
pocopepe:fix/315-mirage-multiple-devices

Conversation

@pocopepe

@pocopepe pocopepe commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Block devices from #315, comma separated as discussed.

solo5BlkDev, block and blkMntPoint now take ordered comma separated lists, mapped positionally. Single device setups are unaffected. Added guards for empty list entries and for mixing a / mounted block with others, both error out instead of silently mismapping.

3.1 of 3 from #315.

Related issues

How was this tested?

go test ./pkg/unikontainers/... -v -run "TestHandleExplicitBlockImages|TestNoRootfsMultipleBlockDevs|TestMirageMultipleBlkDevs"

=== RUN   TestHandleExplicitBlockImages
=== RUN   TestHandleExplicitBlockImages/parses_an_ordered_list_of_block_images_and_mount_points
=== RUN   TestHandleExplicitBlockImages/single_image_stays_backward_compatible
=== RUN   TestHandleExplicitBlockImages/empty_block_image_yields_no_devices
=== RUN   TestHandleExplicitBlockImages/mismatched_counts_return_an_error
=== RUN   TestHandleExplicitBlockImages/rootfs_combined_with_other_block_devices_returns_an_error
=== RUN   TestHandleExplicitBlockImages/empty_entries_return_an_error
--- PASS: TestHandleExplicitBlockImages (0.00s)
=== RUN   TestNoRootfsMultipleBlockDevs
--- PASS: TestNoRootfsMultipleBlockDevs (0.00s)
PASS
ok      github.com/urunc-dev/urunc/pkg/unikontainers    0.010s
=== RUN   TestMirageMultipleBlkDevs
--- PASS: TestMirageMultipleBlkDevs (0.00s)
PASS
ok      github.com/urunc-dev/urunc/pkg/unikontainers/unikernels (cached)

Built a MirageOS unikernel declaring two block devices in its Solo5 manifest, storage and data, and ran it through urunc/containerd end to end.

Both devices declared and attached:

$ sudo nerdctl run --rm --runtime io.containerd.urunc.v2 --snapshotter devmapper --network=none docker.io/pocopepe/mirage-multiblock:multi
Solo5: Bindings version v0.12.0
...
2026-08-05T20:14:49-00:00: [INFO] [application] multiblock: block 'storage' -> 20480 sectors of 512 bytes
2026-08-05T20:14:49-00:00: [INFO] [application] multiblock: block 'data'    -> 10240 sectors of 512 bytes
2026-08-05T20:14:49-00:00: [INFO] [application] multiblock: both block devices attached successfully
Solo5: solo5_exit(0) called

Mismatched annotation counts, caught before the VM ever boots:

$ sudo nerdctl run --rm --runtime io.containerd.urunc.v2 --snapshotter devmapper --network=none docker.io/pocopepe/mirage-multiblock:mismatch
FATA[0000] failed to create shim task: OCI runtime create failed: failed to get block devices to attach in sandbox: block images (2) and mount points (1) must have the same count

Pushed images:

LLM usage

Claude Sonnet 5

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

Ref: urunc-dev#315
Signed-off-by: viju <avijusanjai@gmail.com>
@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 806c464
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a73a113296bbd000826cd1f

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.

1 participant