mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-11-11 10:23:17 +08:00
The micro-VM runtime ignored the snapshot scope: every checkpoint took a
whole-guest CH snapshot, and durable-dir volumes — now host-backed rather
than in guest RAM — were left out of it entirely, so their contents did not
survive a suspend.
Checkpoint, with the guest paused either way:
- Full keeps the CH snapshot (moved to snapshotVMState) and adds a tar of
the volumes.
- Data writes only that tar: no memory image, and no base-id, since nothing
will reattach to the frozen virtio-fs lower.
- Any other scope is rejected rather than silently treated as Full.
Restore mirrors it. The volumes are extracted before anything can observe
them — for Full before the share's virtiofsd starts, for Data before the
workload cold-starts. Full then resumes the guest as before; Data cold-boots
the actor, which is a Run with the volumes already populated, so RunWorkload's
body becomes coldBootActor and both paths share it. Cold boot gates on readyz,
so a Data-scope resume returns with the actor serving.
Pausing first is what makes the tar coherent: the durable share is served
write-through, so every completed guest write is already on the host and no
further ones can arrive. The tar's duration is logged next to the snapshot's —
it is on the suspend path and scales with the volume's contents.
With two virtio-fs devices, the snapshot's fs sockets are now repointed by
device tag instead of all being set to the overlay lower's socket, which would
have handed the guest the wrong filesystem.