Refactor/disk info base disk v7 schema#335
Merged
DorianZheng merged 3 commits intomainfrom Mar 4, 2026
Merged
Conversation
Extract shared disk metadata (path, sizes) into a serializable `DiskInfo` struct embedded via `#[serde(flatten)]` in `BaseDisk` and `SnapshotInfo`. This centralizes disk metadata that was previously duplicated across snapshot and clone types. Key changes: - Add `DiskInfo` DTO with `From<&Disk>` / `to_disk()` conversions - Add `BaseDisk` domain type for immutable COW fork points (snapshots, clone bases, rootfs cache) with `BaseDiskManager` for lifecycle ops - Add `SnapshotManager` to orchestrate snapshot create/restore/remove using the new `BaseDisk` layer - Bump DB schema to v7: add `base_disk`, `base_disk_ref`, `snapshot` tables; migrate from `box_snapshot`; add v6→v7 migration - Add `clone_boxes` batch clone support to `BoxBackend` trait and REST proxy implementation - Refactor `guest_rootfs_manager` to use `BaseDisk` for rootfs caching - Update Node.js/Python SDK bindings for flattened `DiskInfo` fields
The v6→v7 migration was deleting rootfs-base without updating guest-rootfs.qcow2's backing file reference, breaking legacy boxes. Changes: - Rewrite migrate_rootfs_base to move rootfs-base into bases/ and rebase the qcow2 backing file path via set_backing_file_path() - Add set_backing_file_path() to qcow2 module for updating backing references in qcow2 headers - Add runtime backing chain validation in guest_rootfs.rs to catch broken chains early on restart with a clear error message Verified end-to-end: PyPI 0.6.0 (schema v6) → dev (schema v7) migration preserves boxes, snapshots, and disk data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.