Skip to content

Conversation

@yuhong-zhong
Copy link
Contributor

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 [email protected]

@yuhong-zhong yuhong-zhong requested a review from a team as a code owner September 18, 2024 18:35
Copy link
Member

@rbradford rbradford left a comment

Choose a reason for hiding this comment

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

Looks correct to me. Thank you very much!

@rbradford
Copy link
Member

Best to use git commit -s to generate the SoB so that the check passes.

@yuhong-zhong
Copy link
Contributor Author

@rbradford Thank you for the review! I've generated the SoB to fix it.

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 <[email protected]>
@rbradford rbradford added this pull request to the merge queue Sep 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 19, 2024
@liuw liuw added this pull request to the merge queue Sep 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 19, 2024
@rbradford rbradford added this pull request to the merge queue Sep 19, 2024
Merged via the queue into cloud-hypervisor:main with commit 2ad8fac Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants