From f4e391922fb7e1294b48dcaa272279ea56275613 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 14 Oct 2020 14:00:05 +0200 Subject: [PATCH] vmm: Remove balloon options from --memory parameter The standalone `--balloon` parameter being fully functional at this point, we can get rid of the balloon options from the --memory parameter. Signed-off-by: Sebastien Boeuf --- docs/memory.md | 18 +----------------- src/main.rs | 5 +---- vmm/src/api/openapi/cloud-hypervisor.yaml | 10 ++-------- vmm/src/config.rs | 18 +----------------- 4 files changed, 5 insertions(+), 46 deletions(-) diff --git a/docs/memory.md b/docs/memory.md index 7b80f79f3..1fb95b15a 100644 --- a/docs/memory.md +++ b/docs/memory.md @@ -18,14 +18,12 @@ struct MemoryConfig { hotplug_method: HotplugMethod, hotplug_size: Option, hotplugged_size: Option, - balloon: bool, - balloon_size: u64, zones: Option>, } ``` ``` ---memory Memory parameters "size=,mergeable=on|off,shared=on|off,hugepages=on|off,hotplug_method=acpi|virtio-mem,hotplug_size=,hotplugged_size=,balloon=on|off" +--memory Memory parameters "size=,mergeable=on|off,shared=on|off,hugepages=on|off,hotplug_method=acpi|virtio-mem,hotplug_size=,hotplugged_size=" ``` ### `size` @@ -142,20 +140,6 @@ _Example_ --memory size=1G,hotplug_method=virtio-mem,hotplug_size=1G,hotplugged_size=512M ``` -### `balloon` - -Specifies if the `virtio-balloon` device must be activated. This creates a -dedicated virtio device for managing the balloon in the guest, which allows -guest to access more or less memory depending on the balloon size. - -By default this option is turned off. - -_Example_ - -``` ---memory size=1G,balloon=on -``` - ## Advanced Parameters `MemoryZoneConfig` or what is known as `--memory-zone` from the CLI perspective diff --git a/src/main.rs b/src/main.rs index 25e00e208..30bf4c07e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -111,8 +111,7 @@ fn create_app<'a, 'b>( \"size=,mergeable=on|off,shared=on|off,hugepages=on|off,\ hotplug_method=acpi|virtio-mem,\ hotplug_size=,\ - hotplugged_size=,\ - balloon=on|off\"", + hotplugged_size=\"", ) .default_value(&default_memory) .group("vm-config"), @@ -572,8 +571,6 @@ mod unit_tests { hotplugged_size: None, shared: false, hugepages: false, - balloon: false, - balloon_size: 0, zones: None, }, kernel: Some(KernelConfig { diff --git a/vmm/src/api/openapi/cloud-hypervisor.yaml b/vmm/src/api/openapi/cloud-hypervisor.yaml index cc1cbb21d..5de235755 100644 --- a/vmm/src/api/openapi/cloud-hypervisor.yaml +++ b/vmm/src/api/openapi/cloud-hypervisor.yaml @@ -537,12 +537,6 @@ components: hugepages: type: boolean default: false - balloon: - type: boolean - default: false - balloon_size: - type: integer - format: int64 zones: type: array items: @@ -810,8 +804,8 @@ components: description: desired memory ram in bytes type: integer format: int64 - desired_ram_w_balloon: - description: desired ballon size in bytes + desired_balloon: + description: desired balloon size in bytes type: integer format: int64 diff --git a/vmm/src/config.rs b/vmm/src/config.rs index e64a025cc..691b6841e 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -418,10 +418,6 @@ pub struct MemoryConfig { #[serde(default)] pub hugepages: bool, #[serde(default)] - pub balloon: bool, - #[serde(default)] - pub balloon_size: u64, - #[serde(default)] pub zones: Option>, } @@ -436,8 +432,7 @@ impl MemoryConfig { .add("hotplug_size") .add("hotplugged_size") .add("shared") - .add("hugepages") - .add("balloon"); + .add("hugepages"); parser.parse(memory).map_err(Error::ParseMemory)?; let size = parser @@ -472,11 +467,6 @@ impl MemoryConfig { .map_err(Error::ParseMemory)? .unwrap_or(Toggle(false)) .0; - let balloon = parser - .convert::("balloon") - .map_err(Error::ParseMemory)? - .unwrap_or(Toggle(false)) - .0; let zones: Option> = if let Some(memory_zones) = &memory_zones { let mut zones = Vec::new(); @@ -546,8 +536,6 @@ impl MemoryConfig { hotplugged_size, shared, hugepages, - balloon, - balloon_size: 0, zones, }) } @@ -581,8 +569,6 @@ impl Default for MemoryConfig { hotplugged_size: None, shared: false, hugepages: false, - balloon: false, - balloon_size: 0, zones: None, } } @@ -2194,8 +2180,6 @@ mod tests { hotplugged_size: None, shared: false, hugepages: false, - balloon: false, - balloon_size: 0, zones: None, }, kernel: Some(KernelConfig {