Skip to content

Conversation

appcypher
Copy link
Member

Add public API for using OverlayFS functionality in libkrun on macOS by exposing the implementation through a new FsImplConfig enum. This allows clients to configure either passthrough or overlayfs filesystem modes.

Key changes:

  • Add FsImplConfig enum to select between Passthrough and Overlayfs modes
  • Add FsImplShare enum to handle different sharing configurations
  • Refactor Fs implementation to delegate operations to selected backend
  • Update Config struct to include layers configuration
  • Clean up and reorganize filesystem server code
  • Add comprehensive test coverage for overlayfs operations

The implementation maintains the existing passthrough functionality while adding the ability to configure overlayfs mode with multiple read-only layers and a writable top layer.

Add public API for using OverlayFS functionality in libkrun on macOS by exposing
the implementation through a new FsImplConfig enum. This allows clients to
configure either passthrough or overlayfs filesystem modes.

Key changes:
- Add FsImplConfig enum to select between Passthrough and Overlayfs modes
- Add FsImplShare enum to handle different sharing configurations
- Refactor Fs implementation to delegate operations to selected backend
- Update Config struct to include layers configuration
- Clean up and reorganize filesystem server code
- Add comprehensive test coverage for overlayfs operations

The implementation maintains the existing passthrough functionality while adding
the ability to configure overlayfs mode with multiple read-only layers and a
writable top layer.
Add special case handling in the lookup method to return a predefined entry
when looking up "init.krun" file. This allows exposing the init binary with
specific permissions (755) and size based on the included binary data.
- Set init.krun inode ID dynamically using next_inode counter
- Reorder init.krun inode check before handle data lookup in read()
- Add documentation about default values for config options
- Clarify proc_sfd_rawfd usage in sandboxing scenarios
- Update comments to specifically reference init.krun
@appcypher appcypher force-pushed the appcypher/overlayfs-macos-api branch from 9355d78 to c82e331 Compare March 24, 2025 09:33
@appcypher appcypher merged commit 5d1bcd0 into develop Mar 24, 2025
@appcypher appcypher deleted the appcypher/overlayfs-macos-api branch March 24, 2025 10:48
appcypher added a commit that referenced this pull request Jun 8, 2025
* feat(fs): expose overlayfs API for macOS

Add public API for using OverlayFS functionality in libkrun on macOS by exposing
the implementation through a new FsImplConfig enum. This allows clients to
configure either passthrough or overlayfs filesystem modes.

Key changes:
- Add FsImplConfig enum to select between Passthrough and Overlayfs modes
- Add FsImplShare enum to handle different sharing configurations
- Refactor Fs implementation to delegate operations to selected backend
- Update Config struct to include layers configuration
- Clean up and reorganize filesystem server code
- Add comprehensive test coverage for overlayfs operations

The implementation maintains the existing passthrough functionality while adding
the ability to configure overlayfs mode with multiple read-only layers and a
writable top layer.

* feat(overlayfs): add special handling for init.krun lookup

Add special case handling in the lookup method to return a predefined entry
when looking up "init.krun" file. This allows exposing the init binary with
specific permissions (755) and size based on the included binary data.

* fix(overlayfs): improve init.krun inode handling and documentation

- Set init.krun inode ID dynamically using next_inode counter
- Reorder init.krun inode check before handle data lookup in read()
- Add documentation about default values for config options
- Clarify proc_sfd_rawfd usage in sandboxing scenarios
- Update comments to specifically reference init.krun

* refactor(fs): remove debug println statements from overlayfs
appcypher added a commit that referenced this pull request Jun 26, 2025
* feat(fs): expose overlayfs API for macOS

Add public API for using OverlayFS functionality in libkrun on macOS by exposing
the implementation through a new FsImplConfig enum. This allows clients to
configure either passthrough or overlayfs filesystem modes.

Key changes:
- Add FsImplConfig enum to select between Passthrough and Overlayfs modes
- Add FsImplShare enum to handle different sharing configurations
- Refactor Fs implementation to delegate operations to selected backend
- Update Config struct to include layers configuration
- Clean up and reorganize filesystem server code
- Add comprehensive test coverage for overlayfs operations

The implementation maintains the existing passthrough functionality while adding
the ability to configure overlayfs mode with multiple read-only layers and a
writable top layer.

* feat(overlayfs): add special handling for init.krun lookup

Add special case handling in the lookup method to return a predefined entry
when looking up "init.krun" file. This allows exposing the init binary with
specific permissions (755) and size based on the included binary data.

* fix(overlayfs): improve init.krun inode handling and documentation

- Set init.krun inode ID dynamically using next_inode counter
- Reorder init.krun inode check before handle data lookup in read()
- Add documentation about default values for config options
- Clarify proc_sfd_rawfd usage in sandboxing scenarios
- Update comments to specifically reference init.krun

* refactor(fs): remove debug println statements from overlayfs
appcypher added a commit that referenced this pull request Jun 26, 2025
* feat(fs): expose overlayfs API for macOS

Add public API for using OverlayFS functionality in libkrun on macOS by exposing
the implementation through a new FsImplConfig enum. This allows clients to
configure either passthrough or overlayfs filesystem modes.

Key changes:
- Add FsImplConfig enum to select between Passthrough and Overlayfs modes
- Add FsImplShare enum to handle different sharing configurations
- Refactor Fs implementation to delegate operations to selected backend
- Update Config struct to include layers configuration
- Clean up and reorganize filesystem server code
- Add comprehensive test coverage for overlayfs operations

The implementation maintains the existing passthrough functionality while adding
the ability to configure overlayfs mode with multiple read-only layers and a
writable top layer.

* feat(overlayfs): add special handling for init.krun lookup

Add special case handling in the lookup method to return a predefined entry
when looking up "init.krun" file. This allows exposing the init binary with
specific permissions (755) and size based on the included binary data.

* fix(overlayfs): improve init.krun inode handling and documentation

- Set init.krun inode ID dynamically using next_inode counter
- Reorder init.krun inode check before handle data lookup in read()
- Add documentation about default values for config options
- Clarify proc_sfd_rawfd usage in sandboxing scenarios
- Update comments to specifically reference init.krun

* refactor(fs): remove debug println statements from overlayfs
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