containers / libkrun

A dynamic library providing Virtualization-based process isolation capabilities
Apache License 2.0
920 stars 76 forks source link

Add krun_add_disk() method #217

Closed alyssarosenzweig closed 2 months ago

alyssarosenzweig commented 2 months ago
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.

alyssarosenzweig commented 2 months ago

Per @slp's suggestion I have reworked this.

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