feat(vm): add prepare lend mthp option#7
Merged
Conversation
Contributor
lateautumn233
commented
May 13, 2026
- Decouple --prepare-lend-mthp from hugepages in crosvm backend
- Add UI toggle for prepare lend mTHP (disabled by default)
- Display toggle after hugepages in VM options
There was a problem hiding this comment.
Pull request overview
Adds a new VM option to control CrosVM’s --prepare-lend-mthp flag independently from hugepages, exposing it as a UI toggle (disabled by default) and persisting it into the VM config.
Changes:
- Added a new localized string for “Prepare Lend mTHP”.
- Added a new
SwitchRowWidgetin the VM basic options UI and wired it into config load/save. - Updated CrosVM command construction to append
--prepare-lend-mthpbased on its own config flag (no longer gated by hugepages).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/src/main/res/values/strings.xml | Adds English label for the new option. |
| app/src/main/res/values-zh-rCN/strings.xml | Adds Simplified Chinese label for the new option. |
| app/src/main/res/layout/partial_vm_edit_basic.xml | Adds the new switch row in the VM options section (after hugepages). |
| app/src/main/java/cn/classfun/droidvm/ui/vm/edit/basic/VMEditBasicTab.java | Loads/saves the new config key prepare_lend_mthp. |
| app/src/main/java/cn/classfun/droidvm/daemon/vm/backend/CrosvmBackendInstance.java | Emits --prepare-lend-mthp independently from --hugepages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -76,6 +78,7 @@ public void loadConfig(@NonNull VMConfig config) { | |||
| swUsb.setChecked(item.optBoolean("usb", false)); | |||
| swSandbox.setChecked(item.optBoolean("sandbox", false)); | |||
| swHugepages.setChecked(item.optBoolean("hugepages", false)); | |||
- Decouple --prepare-lend-mthp from hugepages in crosvm backend - Add UI toggle for prepare lend mTHP (enabled by default) - Display toggle after hugepages in VM options
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.