Skip to content

openvmm_entry: implement CapabilitiesVM and PropertiesVM#3637

Open
jlevere wants to merge 1 commit into
microsoft:mainfrom
jlevere:vmservice-capabilities-properties
Open

openvmm_entry: implement CapabilitiesVM and PropertiesVM#3637
jlevere wants to merge 1 commit into
microsoft:mainfrom
jlevere:vmservice-capabilities-properties

Conversation

@jlevere

@jlevere jlevere commented Jun 3, 2026

Copy link
Copy Markdown

Summary

CapabilitiesVM and PropertiesVM are declared in vmservice.proto but the
handler returned "not supported" for both. This wires them up.

  • PropertiesVM reports a VmState (Uninitialized/Paused/Running/Halted)
    and halt_reason, tracked from the service's lifecycle events. The
    paused/running value only changes once a Pause/Resume RPC is confirmed by
    the worker, and halt comes from the GuestHalt controller event.
  • CapabilitiesVM reports the resource kinds and guest OSes that
    modify_resource() actually accepts today (SCSI add/remove, VMNic add).

Both answer without a created VM, and both apply to --ttrpc and --grpc,
which share the handler.

MemoryStats/ProcessorStats are left unset rather than reported as zeros,
since real values would need a new VmRpc to query the worker. That can
follow later.

Testing

Extended the existing test_ttrpc_interface integration test to cover the
capabilities response and the state transitions: Uninitialized before
CreateVm, Paused after (and that stats come back unset, not zeroed), and
Halted with a non-empty halt_reason once the guest powers off. Passes
against a Linux direct-boot guest. cargo clippy and cargo xtask fmt are
clean.

Copilot AI review requested due to automatic review settings June 3, 2026 03:22
@jlevere jlevere requested a review from a team as a code owner June 3, 2026 03:22
@jlevere

jlevere commented Jun 3, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds lifecycle/capabilities introspection to the ttrpc VM service by extending the PropertiesVm response with VM state + halt reason, and by implementing CapabilitiesVm/PropertiesVm responses from worker-side bookkeeping. It also updates integration tests to validate these new semantics.

Changes:

  • Extend vmservice.proto with VmState and new PropertiesVMResponse fields (state, halt_reason).
  • Implement local CapabilitiesVm/PropertiesVm handlers and lifecycle tracking in the ttrpc worker (paused/running/halted/uninitialized).
  • Add vmm_tests assertions for capabilities, lifecycle state transitions, and “stats unset” behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
vmm_tests/vmm_tests/tests/tests/ttrpc.rs Adds assertions validating Capabilities/Properties behavior and lifecycle state transitions.
openvmm/openvmm_ttrpc_vmservice/src/vmservice.proto Introduces VmState and new Properties fields to expose lifecycle state and halt reason.
openvmm/openvmm_entry/src/ttrpc/mod.rs Implements state bookkeeping, local Capabilities/Properties replies, and pause/resume state propagation.

Comment thread openvmm/openvmm_entry/src/ttrpc/mod.rs Outdated
Comment thread openvmm/openvmm_entry/src/ttrpc/mod.rs
Comment thread openvmm/openvmm_entry/src/ttrpc/mod.rs
Comment thread openvmm/openvmm_ttrpc_vmservice/src/vmservice.proto Outdated
@jlevere jlevere force-pushed the vmservice-capabilities-properties branch from 10f8f9a to db28962 Compare June 3, 2026 03:33
Copilot AI review requested due to automatic review settings June 3, 2026 03:41
@jlevere jlevere force-pushed the vmservice-capabilities-properties branch from db28962 to 57a312f Compare June 3, 2026 03:41

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread openvmm/openvmm_entry/src/ttrpc/mod.rs
Comment thread openvmm/openvmm_entry/src/ttrpc/mod.rs
Comment thread openvmm/openvmm_entry/src/ttrpc/mod.rs Outdated
These two RPCs were declared in vmservice.proto but the handler rejected
every call with "not supported". Wire them up.

PropertiesVM reports a new VmState enum (UNINITIALIZED / PAUSED / RUNNING
/ HALTED) plus halt_reason, sourced from VmService lifecycle bookkeeping.
The paused/running distinction only changes once a Pause/Resume RPC is
confirmed by the worker, and halt is taken from the GuestHalt controller
event. Memory and processor stats are left unset rather than reporting
zeros, since populating them requires a new VmRpc to query the worker;
deferred to a follow-up.

CapabilitiesVM reports the supported resource kinds and guest OSes,
mirroring what modify_resource() handles today (SCSI add+remove, VMNic
add). Both methods answer without a created VM, so clients can probe
capabilities/state at any time.
@jlevere jlevere force-pushed the vmservice-capabilities-properties branch from 57a312f to f1f6def Compare June 3, 2026 04:12
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