You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
microVM: claim a resume snapshot before linking its direct-claimed scratch #565
Restoring an instance-checkpoint snapshot whose paired scratch uses the direct-claimed policy hard-links scratch.img into a private directory before OpenVMM claims the snapshot. The architecture guide in doc/design/ orders it the other way: restore claims a resume-policy snapshot in step 8 of the restore sequence and materializes scratch in step 10 (section 5.5.1), and direct-claimed scratch is attached "only after an instance checkpoint has been durably and exclusively claimed" (Table 5.5 in section 5.5.2).
Found while auditing the implementation against the architecture guide.
prepare.rs L99 then calls snapshot.claim_for_restore(), which creates and flushes resume.claim (restore.rs L419-L463). Its own documentation asks callers to claim "after artifact and configuration validation and before constructing execution-owned workers".
Opening the snapshot rejects an existing resume.claim (restore.rs L472-L475), so a restore that starts after another one has claimed the snapshot fails before it links anything. Two restores that open the snapshot before either claims it both link the claimed instance's scratch. The loser fails at the claim and drops its temporary directory, but a crash between the link and that cleanup leaves a writable hard link to the live instance's scratch beside the snapshot.
The management RPC is unaffected: it rejects snapshots with sandbox blocks.
Intended behavior
A direct-claimed restore links or attaches the paired scratch only after the claim marker is durable, as section 5.5.1 orders it.
Tasks
Claim the resume snapshot before prepare_restore materializes direct-claimed scratch, or move the materialization after the claim, in nanvix/openvmm, and promote the pin.
Add OpenVMM coverage that a restore that loses the claim never links the paired scratch.
Activity
openvmm: pin attaching direct-claimed scratch in place
microVM: attach direct-claimed scratch in place instead of linking it