Commit 1caba5c
authored
feat: use hyperlight-host 0.16.0 from crates.io (#99)
* feat: adapt to hyperlight-host 0.16.0 from crates.io
Switch from git dep (danbugs/hyperlight) to crates.io hyperlight-host
0.16.0. Key API changes:
- Snapshot format: to_file/from_file_unchecked -> OCI save/load
- snapshot.hls (single file) -> snapshot/ (OCI dir)
- map_file_cow: 3-arg -> 2-arg (label param removed)
- restore_preserving_file_mappings removed; re-map initrd after restore
- Remove sparsify_snapshot (OCI format handles storage)
- Remove whp-no-surrogate feature (now runtime env var)
- Add max_surrogates API to configure_surrogates/InstallOptions/Runtime
- Reduce default heap from 2560 MiB to 1280 MiB
Signed-off-by: danbugs <danilochiarlone@gmail.com>
* fix: remove extra blank line (fmt)
Signed-off-by: danbugs <danilochiarlone@gmail.com>
* fix: check index.json for OCI snapshot validity
Address Copilot review: check snapshot/index.json instead of just
testing snapshot/ directory existence. Catches interrupted installs
and incomplete OCI layouts with an actionable error message.
Signed-off-by: danbugs <danilochiarlone@gmail.com>
* fix: re-add OCI blob sparsification for snapshot disk usage
The OCI snapshot format writes guest memory as a dense raw blob.
With CONFIG_PAGING=n in our Unikraft build, the heap pages retain
their boot-time PTEs so the snapshot captures the full 1280 MiB
heap even if most pages are untouched. Post-save sparsification
punches holes in zero-filled 4K regions, reducing disk usage from
~1755 MiB back to ~656 MiB.
Linux uses fallocate(PUNCH_HOLE), Windows uses FSCTL_SET_ZERO_DATA.
Signed-off-by: danbugs <danilochiarlone@gmail.com>
* fix: report real disk usage for sparse snapshots on Windows
Use GetCompressedFileSizeW to measure actual on-disk allocation
instead of apparent file size, so Windows benchmark reports match
Linux (which already uses stat block count).
Signed-off-by: danbugs <danilochiarlone@gmail.com>
---------
Signed-off-by: danbugs <danilochiarlone@gmail.com>1 parent 0350d64 commit 1caba5c
10 files changed
Lines changed: 463 additions & 220 deletions
File tree
- .github/workflows
- host
- examples
- src
- bin
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
292 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | 486 | | |
492 | 487 | | |
493 | 488 | | |
494 | | - | |
495 | | - | |
496 | | - | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
497 | 492 | | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
506 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
507 | 509 | | |
508 | 510 | | |
509 | 511 | | |
| |||
0 commit comments