cloud-hypervisor/vmm
Yuhong Zhong 2ad8fac624 vmm: memory_manager: Fix bound checks for memory hotplug
Bound checks for virtio-mem and ACPI memory hotplug are off by
one and two, respectively. This prevents users to fully use the reserved
memory hotplug size.

For ACPI, if we specific `--memory size=2G,hotplug_size=4G` and run
`ch-remote resize --memory 6G`, cloud-hypervisor will report the
following error because of the incorrect bound check:

`<vmm> ERROR:vmm/src/lib.rs:1631 -- Error when resizing VM:
MemoryManager(InsufficientHotplugRam)`

Similarly, for virtio-mem, cloud-hypervisor will fail the incorrect
bound check and abort the resize. The VM will see the following error
in dmesg:

`virtio_mem virtio3: unknown error, marking device broken: -22`

This patch has fixed both bound checks and ensure that users can
hot add memory up to the reserved hotplug size.

Signed-off-by: Yuhong Zhong <yz@cs.columbia.edu>
2024-09-19 18:02:20 +00:00
..
src vmm: memory_manager: Fix bound checks for memory hotplug 2024-09-19 18:02:20 +00:00
build.rs build: Add "fuzzing" as a valid cfg(..) attribute 2024-05-08 08:10:28 +00:00
Cargo.toml build: Bump anyhow from 1.0.86 to 1.0.87 2024-09-10 00:03:10 +00:00