Skip to content

Add krun_add_disk() method#217

Merged
slp merged 5 commits intocontainers:mainfrom
alyssarosenzweig:disk2
Sep 19, 2024
Merged

Add krun_add_disk() method#217
slp merged 5 commits intocontainers:mainfrom
alyssarosenzweig:disk2

Conversation

@alyssarosenzweig
Copy link
Copy Markdown
Contributor

This generalizes over krun_set_{root,data}_disk(). Notably:

* It allows arbitrarily many disk images.
* It allows mounting disks read-only.

To implement, we refactor a bit the existing handling while allowing
both APIs to be used together.

This is required to mount systemwide squashfs images which Asahi will use for FEX.

Comment thread src/libkrun/src/lib.rs Outdated
Comment thread src/libkrun/src/lib.rs Outdated
Comment thread src/libkrun/src/lib.rs Outdated
Comment thread src/libkrun/src/lib.rs Outdated
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
@alyssarosenzweig
Copy link
Copy Markdown
Contributor Author

Per @slp's suggestion I have reworked this.

  • Both APIs are still supported, but the interaction is not supported. If add_disk is used, set_* must not be used.
  • set_* is now formally deprecated, slated for removal in 2.0. Users should migrate to add_disk.
  • "root" and "data" are now legal add_disk labels.

This retains b/w compat without introducing too much silliness. Hopefully we're all happy with this now 😄

This generalizes over krun_set_{root,data}_disk(). Notably:

* It allows arbitrarily many disk images.
* It allows mounting disks read-only.
* It does not assume specific root/data semantics.
* It allows setting labels.

To implement, we refactor a bit the existing handling. The set_*_disk
methods are deprecated due to the above issues, and will be removed in a
future major version. For now both APIs are supported but are mutually
exclusive.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
@slp slp merged commit bad9fc9 into containers:main Sep 19, 2024
slp pushed a commit to AsahiLinux/muvm that referenced this pull request Sep 26, 2024
This adds a mechanism for automatically managing the FEX rootfs,
mounting and overlayfs'ing the relevant squashfs files from the host (as
many as desired).

Depends on:

 * libkrun containers/libkrun#217
 * libkrunfw containers/libkrunfw#65

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
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.

3 participants