-
Notifications
You must be signed in to change notification settings - Fork 166
Prevent battery from being added for isolated VMs instead of failing #2724
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
base: main
Are you sure you want to change the base?
Prevent battery from being added for isolated VMs instead of failing #2724
Conversation
There was a problem hiding this 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_enabledfield 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() { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting for discussion on openvmm dev channel thread-- but also i think we should add a TODO to remove that check once we start supporting this
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.