Prevent battery from being added for isolated VMs instead of failing#2724
Open
maheeraeron wants to merge 2 commits intomicrosoft:mainfrom
Open
Prevent battery from being added for isolated VMs instead of failing#2724maheeraeron wants to merge 2 commits intomicrosoft:mainfrom
maheeraeron wants to merge 2 commits intomicrosoft:mainfrom
Conversation
maheeraeron
commented
Feb 2, 2026
Contributor
There was a problem hiding this comment.
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_enabledfield in validation function to indicate it no longer requires validation
chris-oo
reviewed
Feb 2, 2026
|
|
||
| if dps.general.battery_enabled { | ||
| // Battery is not supported for isolated VMs. | ||
| if dps.general.battery_enabled && !isolation.is_isolated() { |
Member
There was a problem hiding this comment.
should this be a warn message that we're ignoring this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.