Skip to content

Conversation

@tjones60
Copy link
Contributor

@tjones60 tjones60 commented Dec 9, 2025

Move some stuff around so configuring VTL2 settings is done the same way across both backends.

Copilot AI review requested due to automatic review settings December 9, 2025 23:35
@tjones60 tjones60 requested a review from a team as a code owner December 9, 2025 23:35
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

This PR refactors VTL2 (Virtual Trust Level 2) settings configuration to be backend-agnostic, allowing both OpenVMM and Hyper-V backends to configure VTL2 settings using the same unified API. This improves consistency and maintainability across the petri test framework.

Key changes:

  • Simplified Vtl2StorageControllerBuilder API by replacing scsi() and with_protocol() with a single new(protocol) constructor
  • Moved VTL2 settings from backend-specific resources to a shared PetriVmRuntimeConfig structure
  • Unified VTL2 settings modification through vm.modify_vtl2_settings() instead of backend-specific methods

Reviewed changes

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

Show a summary per file
File Description
petri/src/vm/vtl2_settings.rs Simplified Vtl2StorageControllerBuilder API with unified constructor
petri/src/vm/mod.rs Added PetriVmRuntimeConfig, unified VTL2 settings configuration, and runtime modification methods
petri/src/vm/openvmm/mod.rs Moved VTL2 settings from resources to config, implemented default_vtl2_settings() trait method
petri/src/vm/openvmm/start.rs Updated to return PetriVmRuntimeConfig and apply VTL2 settings consistently
petri/src/vm/openvmm/runtime.rs Changed VTL2 settings modification from stateful to stateless set_vtl2_settings()
petri/src/vm/openvmm/modify.rs Updated to use unified VTL2 settings location
petri/src/vm/openvmm/construct.rs Updated VTL2 storage controller builder usage
petri/src/vm/hyperv/mod.rs Removed backend-specific VTL2 config methods, implemented unified trait methods
vmm_tests/vmm_tests/tests/tests/x86_64/storage.rs Updated tests to use new unified VTL2 settings API
vmm_tests/vmm_tests/tests/tests/x86_64/openhcl_linux_direct.rs Updated to use new Vtl2StorageControllerBuilder::new() API
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs Updated to use new Vtl2StorageControllerBuilder::new() API

@github-actions
Copy link

pub tpm: Option<TpmConfig>,
}

/// VM configuration that can be changed after the VM is created
Copy link
Contributor

Choose a reason for hiding this comment

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

So I understand the intent ... will this eventually include things like disks? (a disk can be added/removed at runtime, but not a controller)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes exactly. In my storage PR #2551 I added the storage controllers here. Also, I do eventually want to separate the creation from the start, so I think it is fine to include things here that can only change when the VM is off, and the PetriVm struct will enforce what is allowed when the VM is running vs stopped (this struct won't be directly exposed to the test).

@tjones60 tjones60 merged commit 8fe489d into microsoft:main Dec 12, 2025
56 checks passed
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