Skip to content

feat(sec-257): vsock support + pool commands#5

Draft
jasonhernandez wants to merge 2 commits into
aljoscha:mainfrom
jasonhernandez:feat/vsock
Draft

feat(sec-257): vsock support + pool commands#5
jasonhernandez wants to merge 2 commits into
aljoscha:mainfrom
jasonhernandez:feat/vsock

Conversation

@jasonhernandez
Copy link
Copy Markdown
Collaborator

@jasonhernandez jasonhernandez commented Apr 7, 2026

Summary

Two features for Thermite's Ember integration (SEC-257):

1. vsock: virtio-vsock for host-guest communication

  • --vsock flag on ember vm create / ember vm fork and vsock: true YAML config
  • Firecracker (Linux): PUT /vsock API — UDS at <state_dir>/vms/<name>/vsock.sock
  • AVF (macOS): VZVirtioSocketDeviceConfiguration + ember-vz bidirectional UDS↔vsock bridge
  • Both platforms expose the same UDS interface — Thermite sees identical behavior

2. vm: --all flag for stop and delete

  • ember vm stop --all and ember vm delete --all for bulk cleanup
  • name becomes optional when --all is used

Files changed

File What
crates/ember-core/src/state/vm.rs VsockInfo struct, field on VmMetadata
crates/ember-core/src/config/vm.rs vsock: Option<bool> in YAML config
crates/ember-linux/src/firecracker/api.rs Vsock type + put_vsock()
crates/ember-linux/src/firecracker/config.rs vsock in config builder
crates/ember-linux/src/vm.rs Wire vsock → Firecracker
crates/ember-macos/src/vm.rs Pass --vsock-path to ember-vz
ember-vz/Sources/EmberVZ/Start.swift VZVirtioSocketDeviceConfiguration + UDS bridge
src/cli/vm.rs --vsock flag, vsock in inspect, --all for stop/delete

Rebased onto main after the ember-core/ember-linux/ember-macos workspace restructuring.

Test plan

  • 26 unit tests pass (cargo test --workspace)
  • cargo build clean on macOS
  • cargo clippy --workspace clean
  • cargo fmt -- --check clean
  • Manual: ember vm create test --image base --vsock creates vsock.sock
  • Manual: ember vm stop --all stops all running VMs

Refs: Thermite SEC-257, blocks SEC-254

🤖 Generated with Claude Code

@jasonhernandez jasonhernandez marked this pull request as draft April 7, 2026 01:49
@jasonhernandez jasonhernandez changed the title vsock: add virtio-vsock support for host-guest communication feat(sec-257): vsock support + pool commands Apr 7, 2026
jasonhernandez and others added 2 commits April 14, 2026 16:09
Add vsock device support across both Firecracker (Linux) and AVF (macOS)
backends, enabling structured host↔guest communication over a Unix domain
socket instead of SSH polling.

CLI: `ember vm create myvm --image base --vsock`
YAML config: `vsock: true`
UDS created at: `<state_dir>/vms/<name>/vsock.sock`

Linux (Firecracker):
- New `PUT /vsock` API call with guest CID and UDS path
- Firecracker natively creates the UDS and bridges to guest AF_VSOCK

macOS (AVF):
- VZVirtioSocketDeviceConfiguration added to VM config
- ember-vz implements a UDS bridge: accepts host connections on the UDS
  and proxies them to guest vsock port 1024, and accepts guest-initiated
  connections on port 1024 and bridges them back to the UDS

Both platforms expose the same UDS interface — Thermite's code path is
identical regardless of the underlying hypervisor.

Co-Authored-By: Claude <noreply@anthropic.com>
ember vm stop --all          # stop all running VMs
ember vm stop --all --force  # SIGKILL all running VMs
ember vm delete --all --force # stop + delete every VM

Useful for cleanup and for ending all VMs (including non-pool
control agent VMs that pool destroy doesn't touch).

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant