feat(runtime-rs): modify onlineCpuMemRequest

Some vmms, such as dragonball, will actively help us
perform online cpu operations when doing cpu hotplug.
Under the old onlineCpuMem interface, it is difficult
to adapt to this situation.

So we modify the semantics of nb_cpus in onlineCpuMemRequest.
In the original semantics, nb_cpus represents the number of
newly added CPUs that need to be online. The modified
semantics become that the number of online CPUs in the guest
needs to be guaranteed.

Fixes: #5030

Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
This commit is contained in:
Yushuo
2023-05-09 14:35:44 +08:00
parent d66f7572dd
commit aaa96c749b
8 changed files with 44 additions and 21 deletions

View File

@@ -176,7 +176,7 @@ impl CpuResource {
agent
.online_cpu_mem(OnlineCPUMemRequest {
wait: false,
nb_cpus: add,
nb_cpus: new,
cpu_only: true,
})
.await