Skip to content

feat: add multi-distro and custom image support#20

Merged
genedna merged 1 commit into
buck2hub:mainfrom
jjl9807:dev
May 15, 2026
Merged

feat: add multi-distro and custom image support#20
genedna merged 1 commit into
buck2hub:mainfrom
jjl9807:dev

Conversation

@jjl9807
Copy link
Copy Markdown
Collaborator

@jjl9807 jjl9807 commented May 15, 2026

  • Bump version to 0.3.0 and update documentation link.
  • Introduce ImageConfig to support guest distro, architecture, source, and digest configuration.
  • Refactor image handling logic to unify built-in distro and custom image creation via the Image::new() interface.
  • Use tracing-indicatif to display progress bars during image downloads.
  • Inject SSH over vhost-vsock startup logic into VMs via cloud-init to improve SSH connection stability.
  • Improve streaming hash computation performance (set sha2 crate opt-level = 3), removing dependency on external sha256sum/sha512sum binaries.
  • Remove kernel/initrd extraction logic; QEMU no longer boots directly from kernel, and the host no longer depends on guestfish or virt-copy-out.
  • Clean up other redundant code.

- Bump version to 0.3.0 and update documentation link.
- Introduce `ImageConfig` to support guest distro, architecture, source, and digest configuration.
- Refactor image handling logic to unify built-in distro and custom image creation via the `Image::new()` interface.
- Use `tracing-indicatif` to display progress bars during image downloads.
- Inject SSH over vhost-vsock startup logic into VMs via cloud-init to improve SSH connection stability.
- Improve streaming hash computation performance (set `sha2` crate `opt-level = 3`), removing dependency on external `sha256sum`/`sha512sum` binaries.
- Remove kernel/initrd extraction logic; QEMU no longer boots directly from kernel, and the host no longer depends on `guestfish` or `virt-copy-out`.
- Clean up other redundant code.

Signed-off-by: jl.jiang <jiangjl9807@gmail.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8901ec897

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/image.rs
Comment on lines +595 to +596
if let Ok(image) = Self::load(&name).await {
return Ok(image);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate cache hit against requested source and digest

This early return reuses any cached image for name without verifying it matches the current request, but name is only a filename stem and does not encode the requested source URL/path or digest. If two different images share a basename (or the digest changes for the same basename), Image::new can silently return the wrong cached image and run VMs against unintended contents.

Useful? React with 👍 / 👎.

Comment thread src/image.rs
Comment on lines +603 to +607
if let (Some(src), Some((digest_type, digest_hex))) = (override_source, override_digest) {
// If source and digest are provided, fetch from source.
fetch_from_source(&src, &image_path, &digest_hex, digest_type.clone()).await?;

image_digest = (digest_type, digest_hex);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject partial image overrides before builtin fallback

ImageConfig::validate() is never invoked, so a config that sets only source or only digest does not fail fast; it falls through to the builtin-image branch. That silently ignores user intent and can produce a different image than requested, making misconfiguration hard to detect and debug.

Useful? React with 👍 / 👎.

@jjl9807 jjl9807 requested a review from genedna May 15, 2026 10:25
@genedna genedna merged commit 6be9db4 into buck2hub:main May 15, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants