petri: add minimal VM builder for performance testing#3012
Merged
jstarks merged 3 commits intomicrosoft:mainfrom Mar 17, 2026
Merged
petri: add minimal VM builder for performance testing#3012jstarks merged 3 commits intomicrosoft:mainfrom
jstarks merged 3 commits intomicrosoft:mainfrom
Conversation
Add PetriVmBuilder::minimal() constructor that creates a VM with the bare minimum device set for performance testing: - VMBus transport + hv_sock (vsock) only - No serial ports (with_serial_output() to re-enable for diagnostics) - No ICs (shutdown, KVP, timesync), SCSI controllers, or crash dump disks - No save/restore verification on boot Supporting builder methods: - is_minimal(): query whether the builder is in minimal mode - with_serial_output(): opt in to serial ports for diagnostics The pipette-as-init cmdline gains conditional console output: when enable_serial is false (minimal mode default), console=ttyS0 is omitted from the kernel cmdline to reduce boot overhead.
jstarks
commented
Mar 16, 2026
jstarks
commented
Mar 16, 2026
jstarks
commented
Mar 16, 2026
- Remove unrelated .gitignore change (perf_logs/) - Skip with_serial_wait_for_rts() when using pipette as init - Deduplicate console/debug kernel cmdline logic: use the existing console variable instead of re-matching arch, and make both console and debug conditional on enable_serial - Default enable_serial to true in new() (non-minimal builder) so existing tests are unaffected - Simplify serial conditionals to use enable_serial alone, since it now fully encodes the desired behavior
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a “minimal VM” mode to Petri’s VM builder to reduce guest/device overhead for performance testing, primarily by disabling default devices/serial and skipping save/restore verification on boot.
Changes:
- Introduces
PetriVmBuilder::minimal()plusis_minimal()andwith_serial_output()to control minimal-mode behavior. - Threads new
minimal_mode/enable_serialproperties into the OpenVMM backend to skip default VMBus ICs, optionally omit serial devices, and avoid save/restore verification. - Updates LinuxDirect kernel cmdline generation to omit
console=...when serial is disabled.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
petri/src/vm/openvmm/start.rs |
Skips save/restore verification when running in minimal mode. |
petri/src/vm/openvmm/construct.rs |
Adds enable_serial plumbing, gates serial setup, and conditionally omits default VMBus ICs in minimal mode. |
petri/src/vm/mod.rs |
Adds minimal-mode + serial flags to the builder/properties and introduces new builder APIs. |
You can also share your feedback on Copilot code review. Take the survey.
smalis-msft
reviewed
Mar 17, 2026
| linux_direct_serial_agent, | ||
| ) | ||
| }; | ||
| let mut emulated_serial_config = emulated_serial_config; |
Contributor
There was a problem hiding this comment.
Just make this mut on the previous line
smalis-msft
approved these changes
Mar 17, 2026
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.
Add PetriVmBuilder::minimal() constructor that creates a VM with the bare minimum device set for performance testing:
Supporting builder methods:
The pipette-as-init cmdline gains conditional console output: when enable_serial is false (minimal mode default), console=ttyS0 is omitted from the kernel cmdline to reduce boot overhead.