Commit 28da479
committed
fix(sandbox): inherit snapshot sandbox id in from_snapshot
from_snapshot() was constructing a fresh MultiUseSandbox via
from_uninit(), which assigns a new monotonically-increasing sandbox
id. The loaded snapshot still carries the id of the sandbox it was
originally captured from, so the very first restore() call after
from_snapshot trips SnapshotSandboxMismatch and aborts before any
guest code runs.
Conceptually the snapshot IS this sandbox's identity when loaded
from disk — the sandbox it was captured from no longer exists.
Inherit the snapshot's sandbox_id and register the loaded snapshot
as this sandbox's active snapshot so subsequent restores match.
Signed-off-by: danbugs <danilochiarlone@gmail.com>1 parent f2b4366 commit 28da479
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
252 | 260 | | |
253 | 261 | | |
254 | 262 | | |
255 | 263 | | |
256 | 264 | | |
257 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
258 | 269 | | |
259 | 270 | | |
260 | 271 | | |
| |||
0 commit comments