mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Move balloon code from MemoryManager to DeviceManager
Now that we have a new dedicated way of asking for a balloon through the CLI and the REST API, we can move all the balloon code to the device manager. This allows us to simplify the memory manager, which is already quite complex. It also simplifies the behavior of the balloon resizing command. Instead of providing the expected size for the RAM, which is complex when memory zones are involved, it now expects the balloon size. This is a much more straightforward behavior as it really resizes the balloon to the desired size. Additionally to the simplication, the benefit of this approach is that it does not need to be tied to the memory manager at all. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -226,7 +226,7 @@ fn resize_api_command(
|
||||
None
|
||||
};
|
||||
|
||||
let desired_ram_w_balloon: Option<u64> = if let Some(balloon) = balloon {
|
||||
let desired_balloon: Option<u64> = if let Some(balloon) = balloon {
|
||||
Some(
|
||||
balloon
|
||||
.parse::<ByteSized>()
|
||||
@@ -240,7 +240,7 @@ fn resize_api_command(
|
||||
let resize = vmm::api::VmResizeData {
|
||||
desired_vcpus,
|
||||
desired_ram,
|
||||
desired_ram_w_balloon,
|
||||
desired_balloon,
|
||||
};
|
||||
|
||||
simple_api_command(
|
||||
@@ -577,7 +577,7 @@ fn main() {
|
||||
.arg(
|
||||
Arg::with_name("balloon")
|
||||
.long("balloon")
|
||||
.help("New memory with balloon size in bytes (supports K/M/G suffix)")
|
||||
.help("New balloon size in bytes (supports K/M/G suffix)")
|
||||
.takes_value(true)
|
||||
.number_of_values(1),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user