@@ -264,29 +264,35 @@ func main() {
264264| ` WithMemory(mib) ` | RAM in MiB | ` 512 ` |
265265| ` WithPorts(...) ` | TCP port forwards from host to guest | none |
266266| ` WithInitOverride(cmd...) ` | Replace OCI ENTRYPOINT/CMD | OCI config |
267+ | ` WithRootFSPath(path) ` | Use pre-built rootfs directory, skip OCI image pull | none |
267268| ` WithRootFSHook(...) ` | Modify rootfs before boot | none |
268269| ` WithPostBoot(...) ` | Run logic after VM process starts | none |
269- | ` WithNetProvider(p) ` | Replace default in-process networking | in-process vnet |
270+ | ` WithNetProvider(p) ` | Replace default runner-side networking with a custom provider | runner-side vnet |
270271| ` WithFirewallRules(...) ` | Firewall rules for frame-level packet filtering | none |
271272| ` WithFirewallDefaultAction(action) ` | Default firewall action when no rule matches | ` Allow ` |
273+ | ` WithPreflightChecker(c) ` | Replace entire preflight checker | platform defaults |
272274| ` WithPreflightChecks(...) ` | Add custom pre-boot checks | KVM + resources |
273275| ` WithVirtioFS(...) ` | Host directory mounts via virtio-fs | none |
274276| ` WithDataDir(p) ` | State, cache, and log directory | ` ~/.config/propolis ` |
275277| ` WithRunnerPath(p) ` | Path to propolis-runner binary | auto-detect |
276278| ` WithLibDir(p) ` | Directory for libkrun/libkrunfw shared libraries | system libs |
277279| ` WithImageCache(c) ` | Custom image cache instance | ` $dataDir/cache/ ` |
280+ | ` WithImageFetcher(f) ` | Custom image fetcher for OCI retrieval | local-then-remote |
281+ | ` WithSpawner(s) ` | Custom runner subprocess spawner | ` DefaultSpawner ` |
278282
279283## Package Overview
280284
281285| Package | CGO? | Description |
282286| ---------| ------| -------------|
283287| ` propolis ` (root) | No | Top-level API: ` Run() ` , ` VM ` type, functional options, hook types |
284- | ` image ` | No | OCI image pull via crane , layer flattening, rootfs extraction, ` KrunConfig ` |
288+ | ` image ` | No | OCI image pull via ` ImageFetcher ` , layer flattening, rootfs extraction, ` KrunConfig ` |
285289| ` krun ` | ** Yes** | CGO bindings to libkrun C API (context, VM config, ` StartEnter ` ) |
286290| ` net ` | No | ` Provider ` interface and ` Config ` /` PortForward ` types |
287291| ` net/firewall ` | No | Frame-level packet filtering with stateful connection tracking |
292+ | ` net/hosted ` | No | Hosted ` net.Provider ` running VirtualNetwork in caller's process with HTTP services |
293+ | ` net/topology ` | No | Shared network topology constants (subnet, gateway, IPs, MTU) |
288294| ` preflight ` | No | ` Checker ` interface, ` Check ` struct, built-in KVM/HVF and port checks |
289- | ` runner ` | No | ` Spawn() ` / ` Process ` for managing the propolis-runner subprocess |
295+ | ` runner ` | No | ` Spawner ` / ` ProcessHandle ` interfaces for managing the propolis-runner subprocess |
290296| ` runner/cmd/propolis-runner ` | ** Yes** | The runner binary (calls ` krun.StartEnter ` , never returns) |
291297| ` ssh ` | No | ECDSA key generation and SSH client for guest communication |
292298| ` state ` | No | flock-based state persistence with atomic JSON writes |
@@ -400,13 +406,14 @@ Go runtime.
400406+-------------------+ +-------------------+
401407```
402408
403- The in-process VirtualNetwork (gvisor-tap-vsock) provides a virtual network
404- (192.168.127.0/24), DHCP, DNS, and TCP port forwarding between host and guest.
405- It communicates with the VM over a Unix domain socket using the QEMU transport
406- (SOCK_STREAM with 4-byte big-endian length-prefixed Ethernet frames). An
407- optional frame-level firewall with stateful connection tracking can be enabled
408- via ` WithFirewallRules() ` . See [ docs/NETWORKING.md] ( docs/NETWORKING.md ) for
409- a deep dive.
409+ By default, the runner creates an in-process VirtualNetwork (gvisor-tap-vsock)
410+ providing a virtual network (192.168.127.0/24), DHCP, DNS, and TCP port
411+ forwarding. For advanced use cases, ` WithNetProvider() ` moves the network stack
412+ to the caller's process -- the ` net/hosted ` package provides a ready-made
413+ provider that also supports HTTP services on the gateway IP. An optional
414+ frame-level firewall with stateful connection tracking can be enabled via
415+ ` WithFirewallRules() ` . See [ docs/NETWORKING.md] ( docs/NETWORKING.md ) for a
416+ deep dive.
410417
411418### Extension Points
412419
0 commit comments