Skip to content

petri: add minimal VM builder for performance testing#3012

Merged
jstarks merged 3 commits intomicrosoft:mainfrom
jstarks:petri-minimal-builder
Mar 17, 2026
Merged

petri: add minimal VM builder for performance testing#3012
jstarks merged 3 commits intomicrosoft:mainfrom
jstarks:petri-minimal-builder

Conversation

@jstarks
Copy link
Member

@jstarks jstarks commented Mar 16, 2026

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.

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.
- 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
@jstarks jstarks marked this pull request as ready for review March 16, 2026 22:43
@jstarks jstarks requested a review from a team as a code owner March 16, 2026 22:43
Copilot AI review requested due to automatic review settings March 16, 2026 22:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() plus is_minimal() and with_serial_output() to control minimal-mode behavior.
  • Threads new minimal_mode / enable_serial properties 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.

linux_direct_serial_agent,
)
};
let mut emulated_serial_config = emulated_serial_config;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just make this mut on the previous line

@jstarks jstarks merged commit b736579 into microsoft:main Mar 17, 2026
56 checks passed
@jstarks jstarks deleted the petri-minimal-builder branch March 17, 2026 17:35
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.

3 participants