Skip to content

feat(memory): support isolated virtio-mem growth on KVM - #4

Merged
ltstriker merged 2 commits into
boxlite-ai:x_featuresfrom
ltstriker:tingliang/box-online-resize
Oct 28, 2026
Merged

ltstriker merged 2 commits into
boxlite-ai:x_featuresfrom
ltstriker:tingliang/box-online-resize

Conversation

@ltstriker

Copy link
Copy Markdown
Member

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.

ltstriker and others added 2 commits October 27, 2026 12:43
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.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 90df1b78-debc-4e55-be54-794019769401

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ltstriker
ltstriker marked this pull request as ready for review October 28, 2026 06:58

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@ltstriker
ltstriker merged commit 9b7c94b into boxlite-ai:x_features Oct 28, 2026
1 of 14 checks passed
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.

1 participant