Skip to content

vmm_tests: vmbus relay test for TDX #1472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

kmehtaintel
Copy link
Contributor

@kmehtaintel kmehtaintel commented Jun 4, 2025

Fix for issue #1268

  • Added changes to petri to be able to run test vm with vmbus relay enabled.
  • Implement the petri vmbus relay config for Hyper-V and OpenVMM
  • Added a new boot test with vmbus relay enable for TDX.

@kmehtaintel kmehtaintel requested a review from a team as a code owner June 4, 2025 17:19
smalis-msft
smalis-msft previously approved these changes Jun 4, 2025
@mebersol mebersol added the backport_2505 Change should be backported to the release/2505 branch label Jun 4, 2025
@tjones60 tjones60 changed the title VmBus relay test for TDX vmm_tests: vmbus relay test for TDX Jun 5, 2025
)

$vssd = Get-Vssd $Vm
$vssd | ForEach-Object {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need ForEach-Object here? For the other functions I was able to directly access the object members.

@@ -197,3 +197,37 @@ function Set-VmScsiControllerTargetVtl
$rasd.TargetVtl = $TargetVtl
$rasd | Set-VmResourceSettings
}

function Enable-VmBusRelay
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think the standard capitalization is VMBus

hyperv_openhcl_uefi_x64[vbs](vhd(windows_datacenter_core_2025_x64)),
hyperv_openhcl_uefi_x64[tdx](vhd(windows_datacenter_core_2025_x64))
)]
async fn vmbus_relay(config: Box<dyn PetriVmConfig>) -> anyhow::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

With this test, I think we can remove the x86_64::vmbus_redirect openvmm-only test.

@@ -190,6 +190,10 @@ impl PetriVmConfig for PetriVmConfigOpenVmm {
fn with_uefi_frontpage(self: Box<Self>, enable: bool) -> Box<dyn PetriVmConfig> {
Box::new(Self::with_uefi_frontpage(*self, enable))
}

fn with_vmbus_relay(self: Box<Self>, _: bool) -> Box<dyn PetriVmConfig> {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should we switch everything to use vmbus redirect (rather than vmbus relay) terminology to be consistent?

@@ -479,6 +485,9 @@ impl PetriVmConfigHyperV {
)?;
}

// Enable/Disable VMBusRelay if requested in config
let _ = vm.set_vmbus_relay(self.vmbus_relay);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we throwing away the result here? Shouldn't we just use ??
Also, this could probably be in the above if let Some(src_igvm_file) block since this would only be relevant for OpenHCL VMs right?

Set-VmSystemSettings $vssd
}

function Disable-VmBusRelay
Copy link
Contributor

Choose a reason for hiding this comment

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

We could simplify this and the calling code by just accepting a boolean and calling the function Set-VMBusRedirect, but not a big deal.

Copy link

github-actions bot commented Jun 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport_2505 Change should be backported to the release/2505 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants