Skip to content

Implement Virtual Machine Lifecycle Management#3

Merged
genedna merged 4 commits intobuck2hub:mainfrom
jjl9807:main
Jan 6, 2026
Merged

Implement Virtual Machine Lifecycle Management#3
genedna merged 4 commits intobuck2hub:mainfrom
jjl9807:main

Conversation

@jjl9807
Copy link
Collaborator

@jjl9807 jjl9807 commented Jan 6, 2026

This PR brings the following changes:

  • Introduce Machine struct in machine.rs to represent a virtual machine, including methods for initialization, spawning, and command execution.
  • Implement QEMU process management in qemu.rs, including launching and logging output.
  • Create SSH handling in ssh.rs, allowing for command execution and connection management via vsock.
  • Add utility functions in utils.rs for directory management and prerequisite checks.
  • Ensure proper cleanup of resources upon machine shutdown and drop.

Signed-off-by: jl.jiang <jiangjl9807@gmail.com>
Signed-off-by: jl.jiang <jiangjl9807@gmail.com>
Signed-off-by: jl.jiang <jiangjl9807@gmail.com>
Signed-off-by: jl.jiang <jiangjl9807@gmail.com>
@genedna genedna requested a review from Copilot January 6, 2026 08:30
@genedna
Copy link
Contributor

genedna commented Jan 6, 2026

@codex review

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a comprehensive virtual machine lifecycle management system using QEMU with SSH connectivity via vsock. The implementation includes image downloading and caching, cloud-init configuration for VM initialization, and proper resource cleanup.

Key Changes:

  • Machine struct with initialization, spawning, execution, and shutdown methods
  • QEMU process management with timeout handling and output logging
  • SSH connection handling over vsock with cancellation token support

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Cargo.toml Defines package metadata and dependencies for the qlean project
src/lib.rs Provides the public API with with_machine helper function
src/machine.rs Core machine lifecycle implementation including initialization, spawning, execution, and cleanup
src/qemu.rs QEMU process launching and management with output capture
src/ssh.rs SSH key generation, connection management, and command execution over vsock
src/utils.rs Utility functions for directory management, CID allocation, and prerequisite checks
src/image.rs Image downloading, checksum verification, and kernel/initrd extraction
tests/single_machine.rs Integration test demonstrating basic VM usage
.github/workflows/check-and-test.yml CI workflow for format, clippy, and test checks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@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: 260d627482

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@genedna genedna merged commit 4357508 into buck2hub:main Jan 6, 2026
6 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.

3 participants