openvmm_entry: implement CapabilitiesVM and PropertiesVM#3637
Open
jlevere wants to merge 1 commit into
Open
Conversation
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
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.protowithVmStateand newPropertiesVMResponsefields (state,halt_reason). - Implement local
CapabilitiesVm/PropertiesVmhandlers 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. |
10f8f9a to
db28962
Compare
db28962 to
57a312f
Compare
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.
57a312f to
f1f6def
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CapabilitiesVMandPropertiesVMare declared invmservice.protobut thehandler returned
"not supported"for both. This wires them up.PropertiesVMreports aVmState(Uninitialized/Paused/Running/Halted)and
halt_reason, tracked from the service's lifecycle events. Thepaused/running value only changes once a
Pause/ResumeRPC is confirmed bythe worker, and halt comes from the
GuestHaltcontroller event.CapabilitiesVMreports the resource kinds and guest OSes thatmodify_resource()actually accepts today (SCSI add/remove, VMNic add).Both answer without a created VM, and both apply to
--ttrpcand--grpc,which share the handler.
MemoryStats/ProcessorStatsare left unset rather than reported as zeros,since real values would need a new
VmRpcto query the worker. That canfollow later.
Testing
Extended the existing
test_ttrpc_interfaceintegration test to cover thecapabilities response and the state transitions:
UninitializedbeforeCreateVm,Pausedafter (and that stats come back unset, not zeroed), andHaltedwith a non-emptyhalt_reasononce the guest powers off. Passesagainst a Linux direct-boot guest.
cargo clippyandcargo xtask fmtareclean.