Skip to content

Prevent battery from being added for isolated VMs instead of failing#2724

Open
maheeraeron wants to merge 2 commits intomicrosoft:mainfrom
maheeraeron:user/maheeraeron/ivm-battery
Open

Prevent battery from being added for isolated VMs instead of failing#2724
maheeraeron wants to merge 2 commits intomicrosoft:mainfrom
maheeraeron:user/maheeraeron/ivm-battery

Conversation

@maheeraeron
Copy link
Contributor

@maheeraeron maheeraeron commented Feb 2, 2026

Work Item: MSFT#59988631

OpenHCL VBS vmm_tests fail on client SKUs because the host sends battery_enabled = true for isolated VMs.

The previous code would reject this configuration with a hard error in validate_isolated_configuration, causing the VM to fail to start.

Instead of failing when battery is requested for isolated VMs, simply skip adding the battery device. The condition for adding battery was changed from:

if dps.general.battery_enabled {
if dps.general.battery_enabled && !isolation.is_isolated() {

This allows isolated VMs to boot successfully even when the host incorrectly requests a battery, while non-isolated VMs continue to get battery support when requested.

@maheeraeron maheeraeron marked this pull request as ready for review February 2, 2026 22:06
@maheeraeron maheeraeron requested a review from a team as a code owner February 2, 2026 22:06
Copilot AI review requested due to automatic review settings February 2, 2026 22:06
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 fixes an issue where OpenHCL VBS vmm_tests fail on client SKUs because the host incorrectly sends battery_enabled = true for isolated VMs. Instead of rejecting the configuration with a hard error, the code now silently ignores the battery request for isolated VMs.

Changes:

  • Modified battery device creation logic to skip battery for isolated VMs
  • Removed validation error that prevented isolated VMs from starting when battery was requested
  • Moved battery_enabled field in validation function to indicate it no longer requires validation


if dps.general.battery_enabled {
// Battery is not supported for isolated VMs.
if dps.general.battery_enabled && !isolation.is_isolated() {
Copy link
Member

Choose a reason for hiding this comment

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

should this be a warn message that we're ignoring this?

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

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.

2 participants