Commit f6c87ff
committed
refactor: Hoist
Ensure that the vm_config field of the `VmResources` struct is
initialized from snapshot data as early as possible. This means that
further steps in the snapshot restore procedure can rely on the
vm_resources object for vm configuration information, instead of needing
to access the microvm state (or passing various parameters down to ever
snapshot restore function aslong with the uninitialized `VmResources`
struct, as was done for dirty page tracking). This change also ensures
that we fail early if the snapshot is malformed in some way, as opposed
to failing after various KVM resources have already (potentially
incorrectly) been initialized.
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>update_vm_config call to begin of restore path1 parent 43f9cbf commit f6c87ff
3 files changed
+22
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
367 | | - | |
368 | 366 | | |
369 | 367 | | |
370 | 368 | | |
| |||
406 | 404 | | |
407 | 405 | | |
408 | 406 | | |
409 | | - | |
410 | 407 | | |
411 | 408 | | |
412 | 409 | | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | 410 | | |
418 | 411 | | |
419 | 412 | | |
420 | 413 | | |
421 | 414 | | |
422 | 415 | | |
423 | 416 | | |
424 | | - | |
425 | | - | |
| 417 | + | |
| 418 | + | |
426 | 419 | | |
427 | 420 | | |
428 | 421 | | |
| |||
466 | 459 | | |
467 | 460 | | |
468 | 461 | | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | 462 | | |
478 | 463 | | |
479 | 464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
395 | 413 | | |
396 | 414 | | |
397 | 415 | | |
398 | 416 | | |
399 | 417 | | |
400 | 418 | | |
401 | | - | |
402 | 419 | | |
403 | 420 | | |
404 | 421 | | |
| |||
422 | 439 | | |
423 | 440 | | |
424 | 441 | | |
425 | | - | |
426 | 442 | | |
427 | 443 | | |
428 | 444 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
| |||
0 commit comments