fix(export): stop shipping the guest rootfs disk in box archives - #1075
fix(export): stop shipping the guest rootfs disk in box archives#1075G4614 wants to merge 1 commit into
Conversation
The guest rootfs disk is a thin COW overlay over the host-global guest rootfs cache, keyed by the bootstrap image plus guest binary version. It holds no user state, and clone and snapshot-restore already treat it as disposable: when it is absent, the next start recreates the overlay from the local cache. Export was the exception. It flattened the overlay into the archive, which both bloated every archive with a host-independent blob and stripped the backing reference, so an imported box would boot from the archived copy instead of the importing host's correctly-versioned cache. Export now omits it and import never installs one, even from an older archive. No archive version bump: the disk was already optional, since a never-started box exported without it, so old importers handle its absence and new importers ignore its presence. guest_disk_checksum stays on the manifest, always empty, so older importers still parse it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Folded into #1080 — that PR already contained this commit, so keeping them split cost an extra review without shrinking the diff. |
Box archives no longer carry the guest rootfs disk, which is host-global state the importing host rebuilds from its own version-keyed cache.
It is a thin COW overlay over the shared guest rootfs cache (keyed by bootstrap image + guest binary version) and holds no user state; clone and snapshot-restore already treat it as disposable. Export was the exception, and flattening stripped its backing reference, so an imported box booted from the archived copy instead of the importing host's correctly-versioned cache. No archive version bump — the disk was already optional, so old importers handle its absence and new ones ignore its presence.
Test plan:
cargo nextest run -p boxlite --no-default-features --lib -E 'test(~export_omits_the_guest_rootfs_disk)'— new regression testgot ["manifest.json", "disk.qcow2", "guest-rootfs.qcow2"]; restored, it passesmake test:integration:rust FILTER=export— 15/15 passed (real VM), includingtest_export_import_roundtrip, which imports and then starts the boxcargo nextest run -p boxlite --no-default-features --lib— 952/954; the two failures (seatbeltsandbox, vendored-libkrun source read) reproduce on a pristine treecargo fmt --all -- --check,cargo clippy -p boxlite --no-default-features --all-targets -- -D warnings