Repository navigation
feat(memory): support isolated virtio-mem growth on KVM - #4
Merged
ltstriker merged 2 commits intoOct 28, 2026
Merged
Conversation
Callers using the bundled libkrunfw kernel could not add kernel parameters: krun_start_enter builds the command line from a fixed prolog plus the krun environment. BoxLite needs "maxcpus=N" to boot with every possible vCPU created but only N online, so it can bring more CPUs online later without restarting the VM. Each call appends one validated token. The tokens go into krun_env, which is appended for both the bundled kernel and one set with krun_set_kernel, so the parameter applies either way. Design: boxlite-ai/boxlite#2126 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Expose grow-only memory requests after VM start, reserve inaccessible slots, and report partial allocation. Count the bundled kernel in the initial RAM budget and keep hotplug ranges outside the x86 MMIO gap.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
ltstriker
marked this pull request as ready for review
October 28, 2026 06:58
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.
TL;DR
Support grow-only RAM hotplug on Linux/KVM while counting the bundled kernel within the configured RAM budget.
Design doc: boxlite-ai/boxlite#2126
Documentation: https://github.com/ltstriker/libkrun/blob/tingliang/box-online-resize/README.md#online-memory-growth-linux-generic-variant
How it works
Add kernel command-line parameters and asynchronous memory request/status APIs. Virtio-mem plugs 2 MiB blocks into 128 MiB KVM slots; unallocated slots stay inaccessible. Preserve partial allocation and keep x86 hotplug outside MMIO.
Dependency of boxlite-ai/boxlite#2138.
Verification
From BoxLite:
make test:unit:libkrun→ passes on x86/KVM. RAM-budget and MMIO regressions fail with fixes reverted and pass when restored. Real VM memory growth passes. ARM remains untested.