Skip to content

petri: add minimal VM builder for performance testing#3012

Open
jstarks wants to merge 2 commits intomicrosoft:mainfrom
jstarks:petri-minimal-builder
Open

petri: add minimal VM builder for performance testing#3012
jstarks wants to merge 2 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.
// ready. Otherwise, Linux will drop the input serial data
// on the floor during boot.
if matches!(firmware, Firmware::LinuxDirect { .. }) {
chipset = chipset.with_serial_wait_for_rts();
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not necessary when we are using pipette as init.

let init = if self.uses_pipette_as_init {
"/pipette"
let (cmdline, enable_serial) = if self.uses_pipette_as_init {
let console_arg = if self.enable_serial {
Copy link
Member Author

Choose a reason for hiding this comment

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

Buncha weird duplicated stuff here.

.gitignore Outdated

# Build output directories for logview_new
**/logview_new/dist*
perf_logs/
Copy link
Member Author

Choose a reason for hiding this comment

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

not relevant in this PR

- 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
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.

1 participant