Skip to content

refactor(vmm): name bridge prepare RPC explicitly - #1064

Merged
kvinwang merged 1 commit into
nextfrom
refactor/vmm-prepare-bridge-rpc
Aug 17, 2026
Merged

refactor(vmm): name bridge prepare RPC explicitly#1064
kvinwang merged 1 commit into
nextfrom
refactor/vmm-prepare-bridge-rpc

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Summary

  • rename netd PrepareRequest to PrepareBridgeRequest
  • rename the prepare operation to prepare_bridge
  • rename bridge-specific validation and preparation helpers accordingly
  • add a protocol serialization test for the explicit operation name

The existing request only prepares a TAP attached to a bridge with a libvirt nwfilter binding. Naming the bridge operation explicitly avoids ambiguity before adding other preparation operations.

Validation

  • cargo clippy for dstack-vmm with all targets and warnings denied
  • cargo test for dstack-vmm: 117 passed

@kvinwang
kvinwang marked this pull request as ready for review August 17, 2026 10:47
Copilot AI lite review requested due to automatic review settings August 17, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 makes the netd “prepare” RPC explicitly bridge-scoped (prepare_bridge) to remove ambiguity ahead of adding additional preparation operations. It updates both the request data types and the VMM caller, and adds a serialization test to lock in the protocol name.

Changes:

  • Renamed PrepareRequest to PrepareBridgeRequest and Request::Prepare to Request::PrepareBridge.
  • Renamed bridge-specific helpers to match the explicit bridge operation naming.
  • Added a protocol serialization test asserting "operation": "prepare_bridge".

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
dstack/vmm/src/netd.rs Renames the prepare request/operation to an explicit bridge variant and adds a JSON serialization test for the operation tag.
dstack/vmm/src/app.rs Updates the VMM’s netd client call site to use PrepareBridgeRequest / Request::PrepareBridge.
Suppressed comments (1)

dstack/vmm/src/app.rs:567

  • This comment refers to the operation as "Prepare", but the request variant is now PrepareBridge. Updating the comment will keep the failure/rollback explanation aligned with the protocol terminology.
                // The client may have timed out while netd was still finishing
                // this Prepare. Remove the in-flight identity first; netd's
                // serialized accept loop processes it after Prepare completes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dstack/vmm/src/netd.rs
@kvinwang
kvinwang merged commit 35e8092 into next Aug 17, 2026
16 checks passed
@kvinwang
kvinwang deleted the refactor/vmm-prepare-bridge-rpc branch August 17, 2026 11:50
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